ipfs-log
ipfs-log copied to clipboard
Feat: improve memory usage / allow for in-memory storage of all entries to be optional (WIP)
⚠️ Note: This PR is a WIP and not ready for review. I'm in the process of cleaning up a fork that I have been using in a proof of concept application. My hope is to minimize the amount of breaking changes further.
Description
Currently, all entries (and all the data in it) are kept in memory. The goal of this PR is to make this optional in order to improve load times and performance on memory-limited environments when interacting with larger/longer log sets.
Related: https://github.com/orbitdb/ipfs-log/issues/136, https://github.com/orbitdb/ipfs-log/issues/203, https://github.com/orbitdb/ipfs-log/pull/239
Breaking Changes
The following getters and methods become async / return promises.
-
log.values
-
log.tails
-
log.tailHashes
-
log.get()
-
log.traverse()
-
log.iterator()
-
log.toString()
-
log.toSnapshot()
Benchmarking
Before wip
After wip
Tradeoffs
wip
TODO
- [x] update tests
- [ ] write new tests
- [ ] update benchmarks / benchmarking / document performance tradeoffs
- [x] adjust entryIndex to allow caching of all entries by default
- [ ] document breaking changes
- [x] update method comments
- [x] squash / clean up commits
- [x] remove forked orbit-db-io
Excited about this if it turns out to work! Would you mind though making this a draft PR until it's ready?
How are you feeling about this one @mistakia ? :)
Feeling like I need to get back in the game! I plan on coming back to this in the not so distant future.
Ok, I'll leave it open then :+1:
@mistakia the not too distant future is upon us :D hope you are happy + healthy in these trying times.
If you want to hop back in I can totally support you. Did you see I finally merged #307 ?
Quick status update of what I think is left. Merge the following into ipfs-log master:
- [x] https://github.com/orbitdb/benchmark-runner/pull/17
- [ ] https://github.com/orbitdb/benchmark-runner/issues/26
After these two I can dig deeper in the benchmarks to make improvements (i.e. analyze various LRU libs)
- [x] update
log.spec
tests - [ ] what to do with errors when loading an entry from a multihash
- [ ] document breaking changes
- [x] update docs