Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trie: AsyncTrie #22798

Closed
jon-chuang opened this issue May 3, 2021 · 0 comments
Closed

trie: AsyncTrie #22798

jon-chuang opened this issue May 3, 2021 · 0 comments

Comments

@jon-chuang
Copy link

jon-chuang commented May 3, 2021

Rationale

Why should this feature exist?

Stop blocking on async IO Trie operations if not needed.

Very similar to futures.

Sequential consistency: job Trie updates guaranteed to execute in order they are called. So AsyncTrie is not multiple writer thread safe but is multiple reader thread safe.

Design is here: #22667 (comment)

Implementation

I will implement this feature, and it can be adopted as a replacement for the entire Trie prefetcher thingy.

(Replace the subfetcher with an AsyncTrie, make prefetch called from TriePrefetcher merely call getAsync() sequentially, and eventually it will be able to return get() for that node with microsecond latency - 100ns non-sequential RAM read per node lookup from root ~ 0.7us per lookup.)

AsyncTrie can replace all other instances of Trie, or not.

By default AsyncTrie is a secure Trie, I will not decouple the impls for simplicity.

However, AsyncTrie has extra methods than Trie.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants