-
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
9 changed files
with
86 additions
and
12 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,6 +1,6 @@ | ||
# https://github.com/dotnet/dotnet-docker/blob/main/README.sdk.md | ||
# https://mcr.microsoft.com/en-us/artifact/mar/dotnet/sdk/tags <-- this shows all images | ||
FROM mcr.microsoft.com/dotnet/sdk:9.0.101-noble | ||
FROM mcr.microsoft.com/dotnet/sdk:9.0.102-noble | ||
|
||
# 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
59 changes: 59 additions & 0 deletions
59
benchmarks/Neo.Benchmarks/Persistence/Bechmarks_LevelDB.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,59 @@ | ||
// Copyright (C) 2015-2025 The Neo Project. | ||
// | ||
// Bechmarks_LevelDB.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 Neo.Persistence; | ||
using Neo.Plugins.Storage; | ||
using Neo.SmartContract; | ||
using System.Diagnostics; | ||
|
||
namespace Neo.Benchmarks.Persistence.Benchmarks | ||
{ | ||
public class Bechmarks_LevelDB | ||
{ | ||
// avoid allocations in benchmarks | ||
private static StorageKey key1; | ||
private static readonly byte[] value = new UInt256().GetSpan().ToArray(); | ||
|
||
private const string PathLevelDB = "Data_LevelDB_Benchmarks"; | ||
|
||
private static readonly LevelDBStore levelDb = new(); | ||
private static ISnapshot snapshot; | ||
|
||
[GlobalSetup] | ||
public void Setup() | ||
{ | ||
if (Directory.Exists(PathLevelDB)) | ||
Directory.Delete(PathLevelDB, true); | ||
|
||
key1 = new KeyBuilder(1, 1).Add(new UInt160()); | ||
|
||
var levelDbStore = levelDb.GetStore(PathLevelDB); | ||
snapshot = levelDbStore.GetSnapshot(); | ||
} | ||
|
||
[GlobalCleanup] | ||
public void Cleanup() | ||
{ | ||
snapshot.Dispose(); | ||
levelDb.Dispose(); | ||
if (Directory.Exists(PathLevelDB)) | ||
Directory.Delete(PathLevelDB, true); | ||
} | ||
|
||
[Benchmark] | ||
public void LevelDBSnapshotWrites() | ||
{ | ||
snapshot.Put(key1.ToArray(), value); | ||
snapshot.Delete(key1.ToArray()); | ||
} | ||
} | ||
} |
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