Comments (4)
Hmm, my bad, as SimpleMap is only used for testing.
from smt.
cc @odeke-em
from smt.
Note that only the SetString
matter, the DeleteString
and GetString
are just the same as Delete
and Get
, but for completeness of APIs, better to introduce the string version for all methods.
If we don't care about backward-compatible, then we can just change the current methods signature, and also un-export SimpleMap
, too, as it's highly coupled to internal usage only.
from smt.
The provided SimpleMap
only exists so users can use the library with no external dependencies, e.g. for testing or prototyping purposes. It's absolutely not meant to be used in production; in production, a k-v store like RocksDB will be used that implements the MapStore
interface, and for that it's important that the key used is a byte slice []byte
since the key will be a hash or something.
Lines 8 to 12 in 85c78b7
TL;DR: no, the MapStore
interface should not be changed to use a string
as the key. And SimpleMap
should not be removed if we want to allow users to start using the library with no external dependencies to at least prototype.
Also, your new benchmark is highly synthetic as it uses the same key over and over. In practice, that won't be the case. Instead, every operation will use a different key. And each key being different means allocating a new slice each time, something that your benchmark omits. If you allocate a new (different) string each iteration, you'll probably see the benchmarks being much closer together.
from smt.
Related Issues (20)
- Optimization for countCommonPrefix HOT 1
- Benchmark different appending schemes HOT 3
- Add more fuzzing-like tests HOT 3
- Offset calculated on every iteration HOT 4
- Add contribution guidelines HOT 2
- Use raw key as path instead of hash(key) HOT 8
- Rebrand lazyledger -> celestiaorg
- Remove or move bench test HOT 4
- Coverage tracking broken HOT 1
- (*SparseMerkleTree).HasDescend should firstly check the error from GetDescend before value comparisons HOT 1
- DeleteForRoot is not right HOT 2
- sanityCheck: only necessarily calculate siblingHash if len(proof.SideNodes > 0 but also return early and unnest
- (*SparseMerkleTree).th.parseNode should check that data retrieved is within limits else panic HOT 5
- Tree sharding to process updates in parallel HOT 5
- Automated CHANGELOG.md check for smt
- The root calculated by an empty Sparse Merkle Tree does not match the expected output defined by the specification HOT 5
- Release new version HOT 1
- SMT v0.4 potential wishlist HOT 3
- Don't recompute the root on every update; only on commit
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smt.