-
Notifications
You must be signed in to change notification settings - Fork 432
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
Skip updating prewarm caches on main thread #7203
Conversation
Does it improve anything? Potentially very small chance of waiting on dictionary? Otherwise, it complicates the code and I don't like it. |
TryGet doesn't use any locks; GetOrAdd does TryGet, then if that fails TryAdd which aquires lock (potentially contending with prewarm) and allocates memory. However the MainProcessor will never read that value from the prewam cache ever again, so why do the extra work? |
src/Nethermind/Nethermind.Consensus/Processing/BlockProcessor.cs
Outdated
Show resolved
Hide resolved
6bd6f4e
to
f159c79
Compare
f159c79
to
b219c7e
Compare
_transientStorageProvider = new TransientStorageProvider(logManager); | ||
} | ||
|
||
public WorldState(ITrieStore trieStore, IKeyValueStore? codeDb, ILogManager? logManager, PreBlockCaches? preBlockCaches) | ||
: this(trieStore, codeDb, logManager, null, preBlockCaches: preBlockCaches) | ||
public WorldState(ITrieStore trieStore, IKeyValueStore? codeDb, ILogManager? logManager, PreBlockCaches? preBlockCaches, bool populatePreBlockCache = true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wonder if it would be better to make it false
as default and explicitly set true, but not sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too many locations; unless invert the meaning of the param.
Is only really really true if it also has the preBlockCaches
not being null
Changes
Types of changes
What types of changes does your code introduce?
Testing
Requires testing