-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into HF_Echidna
- Loading branch information
Showing
200 changed files
with
1,863 additions
and
974 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
FROM mcr.microsoft.com/devcontainers/dotnet:8.0-jammy | ||
FROM mcr.microsoft.com/devcontainers/dotnet:9.0-jammy | ||
# Install the libleveldb-dev package | ||
RUN apt-get update && apt-get install -y libleveldb-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
benchmarks/Neo.Benchmarks/SmartContract/Benchmarks.StorageKey.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// Copyright (C) 2015-2024 The Neo Project. | ||
// | ||
// Benchmarks.StorageKey.cs file belongs to the neo project and is free | ||
// software distributed under the MIT software license, see the | ||
// accompanying file LICENSE in the main directory of the | ||
// repository or http://www.opensource.org/licenses/mit-license.php | ||
// for more details. | ||
// | ||
// Redistribution and use in source and binary forms with or without | ||
// modifications are permitted. | ||
|
||
using BenchmarkDotNet.Attributes; | ||
using System.Text; | ||
|
||
namespace Neo.SmartContract.Benchmark | ||
{ | ||
public class Benchmarks_StorageKey | ||
{ | ||
// for avoiding overhead of encoding | ||
private static readonly byte[] testBytes = Encoding.ASCII.GetBytes("StorageKey"); | ||
|
||
private const int prefixSize = sizeof(int) + sizeof(byte); | ||
|
||
[Benchmark] | ||
public void KeyBuilder_AddInt() | ||
{ | ||
var key = new KeyBuilder(1, 0) | ||
.AddBigEndian(1) | ||
.AddBigEndian(2) | ||
.AddBigEndian(3); | ||
|
||
var bytes = key.ToArray(); | ||
if (bytes.Length != prefixSize + 3 * sizeof(int)) | ||
throw new InvalidOperationException(); | ||
} | ||
|
||
[Benchmark] | ||
public void KeyBuilder_AddIntWithoutPrealloc() | ||
{ | ||
var key = new KeyBuilder(1, 0, 0) | ||
.AddBigEndian(1) | ||
.AddBigEndian(2) | ||
.AddBigEndian(3); | ||
|
||
var bytes = key.ToArray(); | ||
if (bytes.Length != prefixSize + 3 * sizeof(int)) | ||
throw new InvalidOperationException(); | ||
} | ||
|
||
[Benchmark] | ||
public void KeyBuilder_AddBytes() | ||
{ | ||
var key = new KeyBuilder(1, 0) | ||
.Add(testBytes) | ||
.Add(testBytes) | ||
.Add(testBytes); | ||
|
||
var bytes = key.ToArray(); | ||
if (bytes.Length != prefixSize + 3 * testBytes.Length) | ||
throw new InvalidOperationException(); | ||
} | ||
|
||
[Benchmark] | ||
public void KeyBuilder_AddUInt160() | ||
{ | ||
Span<byte> value = stackalloc byte[UInt160.Length]; | ||
var key = new KeyBuilder(1, 0) | ||
.Add(new UInt160(value)); | ||
|
||
var bytes = key.ToArray(); | ||
if (bytes.Length != prefixSize + UInt160.Length) | ||
throw new InvalidOperationException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>netstandard2.1;net8.0</TargetFrameworks> | ||
<TargetFrameworks>netstandard2.1;net9.0</TargetFrameworks> | ||
<PackageId>Neo.ConsoleService</PackageId> | ||
<Nullable>enable</Nullable> | ||
<OutputPath>../../bin/$(PackageId)</OutputPath> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" /> | ||
<PackageReference Include="System.ServiceProcess.ServiceController" Version="8.0.0" /> | ||
<PackageReference Include="System.ServiceProcess.ServiceController" Version="9.0.0" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.