prataprc / cmap Goto Github PK
View Code? Open in Web Editor NEWConcurrent Hash Array Mapped Trie in Rust.
License: MIT License
Concurrent Hash Array Mapped Trie in Rust.
License: MIT License
When we compile bin/perf with pprof
feature and run it via valgrind there seem to be memory-leaks. Is that normal ?
$ cargo build --release --bin perf --features=perf,pprof
$ valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes ~/.cargo/target/release/perf --loads 1000000 --gets 100000
Results in:
==79781== LEAK SUMMARY:
==79781== definitely lost: 327,104 bytes in 2 blocks
==79781== indirectly lost: 17,563,648 bytes in 4,096 blocks
==79781== possibly lost: 0 bytes in 0 blocks
==79781== still reachable: 24,606,855 bytes in 12,003 blocks
==79781== suppressed: 0 bytes in 0 blocks
Right now len() API does a full table walk to count the number of items indexed. Since we cannot guarantee point-in-time-snapshot, why don't we maintain n_count that gets atomically incremented or decremented for insert/delete operations. This can make len() call very cheap.
Along with memory book-keeping accessor functions can count number of compact() operations triggered by remove() access and number of retry operation due to recursive compacts and concurrent updates.
Compute the min, max and average depth of the trie as part of Stats{}
.
We calculate hamming distance by counting ones in u32 type. We are using u32::count_ones()
for this purpose. Not sure how rust will compile to target platform. More research is needed to understand this cost of count_ones for different platforms.
Right now data-structure using SeqCst
ordering for atomic operation, which is the strictest variant. Explore more relaxed ordering and measure performance improvements. May be some one with deeper experience with atomic instructions and its
implication on CPU execution can throw more light.
New items are always indexed in the Node{} type, which holds an array of atomi-ptr to child. For Insert and Remove operation, which is going to modify the array, we will have to do CoW (Copy-no-Write) operation to handle concurrent writes. But for updating
older child pointer with new updated item we can use AtomicStore and avoid CoW.
Not sure about the performance advantages this might bring. If we find that there is no performance improvement, then we can replace AtomicPtr with Box.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.