orbitdb-archive / ipfs-log

Append-only log CRDT on IPFS
https://orbitdb.github.io/ipfs-log/
MIT License
398 stars 55 forks source link

Feat: improve memory usage / allow for in-memory storage of all entries to be optional (WIP) #301

Open mistakia opened 4 years ago

mistakia commented 4 years ago

⚠️ 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.

Benchmarking

Before wip

After wip

Tradeoffs

wip

TODO

aphelionz commented 4 years ago

Excited about this if it turns out to work! Would you mind though making this a draft PR until it's ready?

aphelionz commented 4 years ago

How are you feeling about this one @mistakia ? :)

mistakia commented 4 years ago

Feeling like I need to get back in the game! I plan on coming back to this in the not so distant future.

aphelionz commented 4 years ago

Ok, I'll leave it open then :+1:

aphelionz commented 3 years ago

@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 ?

mistakia commented 3 years ago

Quick status update of what I think is left. Merge the following into ipfs-log master:

After these two I can dig deeper in the benchmarks to make improvements (i.e. analyze various LRU libs)