neo-project / neo-modules

MIT License
60 stars 100 forks source link

Optimized/Rebuild `LevelDB` Native for `LevelDBStore` #899

Closed cschuchardt88 closed 4 months ago

cschuchardt88 commented 5 months ago

Change Log

image

cschuchardt88 commented 5 months ago

@cschuchardt88 @Jim8y @vncoelho @superboyiii @chenzhitong @AnnaShaleva Review Please

cschuchardt88 commented 5 months ago

@vncoelho This is refactoring everything. Im sure there is performance benefits. But that isn't the point of this PR. This PR fixes dotnet management of the leveldb objects from marshal objects. Also you have access to leveldb classes for easy accessibly.

Example

var options = new Options { CreateIfMissing = true };
using (var db = new DB(options, path))
{
    db.Put("NA", "Na");

    using(var batch = new WriteBatch())
    {
        batch.Delete("NA")
             .Put("Tampa", "Green")
             .Put("London", "red")
             .Put("New York", "blue");
        db.Write(batch);
    }
}
cschuchardt88 commented 5 months ago

@shargon @Jim8y review please

cschuchardt88 commented 5 months ago

@AnnaShaleva

Also, have you tested the resulting code against the current mainnet/testnet? Is the state compatible?

Yes

This adds the full features of the leveldb library.

shargon commented 4 months ago

Repository moved to neo, please re-open there