Comments (4)
For the sake of having this documented, we should be mindful that there is a space efficiency optimization and a time efficiency one mixed in this change. If we are doing one or both is a pending discussion.
If we just change the trie without changing how proofs are calculated we could solve the memory issue without a hardfork. While changing the proof calculation to match the new data structure (skipping empty nodes) would require a hardfork.
from lbrycrd.
I was just doing some testing on node counts for this. With a million random strings (standard 60 characters), I end up with 25 million nodes in traditional trie. With the collapsed prefixes, I end up with 1.5 million nodes after a million insertions. That's a substantial difference! Next test: the qp trie. We can talk about where to check in my tests and what to name them next week.
from lbrycrd.
I'm attaching my experiments on this. I originally concluded that the PrefixTrie is the right structure, and that it would drastically reduce our (present) memory usage. I also concluded that we don't need a separate library as it is not a lot of code. Since then a discussion with @shyba pointed out that std::map may be the best container. I did some testing and came to that conclusion as well. I'll leave it here on the shelf and hope that we can get c++11 support in lbrycrd in the very near future. I intend to bring it in without a hard fork (keep the hash calculation functioning the way it is).
from lbrycrd.
Last week I tested the code here with my same sample data: https://github.com/ytakano/radix_tree. It worked well enough, but it was not as fast as std::map. I didn't see a lot of other libraries that were easily accessible. I did not attempt to use Ethereum's trie code. It appeared complex, and I don't want to mix their code in with ours.
from lbrycrd.
Related Issues (20)
- `block_info.status` column has duplicate status for the same block
- Using Chaos Mesh to enhance lbry
- fix database flushing issue related to parallel read access to leveldb/sqlite HOT 2
- Allow claims outside the claimtrie HOT 1
- determine steps to fix getDelayForName in 17.3; we still work around a bug there
- Bring back reproducible builds HOT 2
- v17.4+ writes interior trie nodes to the takeover db
- Get LBRY blockchain listed on Thorchain DEX HOT 2
- TOTP 2FA HOT 1
- make depends boost invalid download url link HOT 8
- Change domain of Travis CI-server to .com
- micro blogging mastodon compatible ActivityPub protocol feature request HOT 1
- compiling fails on debian 11 HOT 1
- Fail Kubuntu 22.04.1 LTS HOT 12
- precompiled vs. docker build HOT 1
- OSX Not using HyperThreading HOT 2
- LBRYcrd using old onion v2 HOT 1
- UPnP Not working. HOT 2
- LBRY Improvement Proposal: Hosting Incentive
- Documentation/link not up to date HOT 1
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 lbrycrd.