Skip to content

Cache the deployment flags to improve startup#340

Merged
sondreb merged 4 commits intomasterfrom
feature/node-performance-3
Jul 4, 2021
Merged

Cache the deployment flags to improve startup#340
sondreb merged 4 commits intomasterfrom
feature/node-performance-3

Conversation

@sondreb
Copy link
Copy Markdown
Member

@sondreb sondreb commented May 18, 2021

  • The deployment flags are cached when calculated as new blocks come in.
  • The deployment flags are read from cache at startup, as they cannot have changed since shutdown.
  • This gives a very big improvement on node startup.
  • Node startup performance #337

- The deployment flags are cached when calculated as new blocks come in.
- The deployment flags are read from cache at startup, as they cannot have changed since shutdown.
- This gives a very big improvement on node startup.
- #337
Copy link
Copy Markdown
Member

@dangershony dangershony left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good idea but we should move the persist to the base feature

@dangershony
Copy link
Copy Markdown
Member

Yes, agree and that was initial thought. Though we likely should cache it in-memory then, so we don't need to calculate the flags on shutdown.

I think its already cached in the component

- Check the flags every minute and persist if needed.
- This only validates ScriptFlags, not BIP30/BIP34/LockTimeFlags.
@sondreb sondreb requested a review from dangershony June 9, 2021 10:39
@sondreb
Copy link
Copy Markdown
Member Author

sondreb commented Jun 9, 2021

Does this prevent from loading it on startup though?

Yes, it loads pre-calculated on startup, from the key-value store. We never need to re-calculate from genesis on secondary launches of the software.

@sondreb sondreb merged commit 7c06cc1 into master Jul 4, 2021
@sondreb sondreb deleted the feature/node-performance-3 branch July 4, 2021 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants