Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Mostly configurable canonical cache size #2516

Merged
merged 5 commits into from
Oct 12, 2016
Merged

Mostly configurable canonical cache size #2516

merged 5 commits into from
Oct 12, 2016

Conversation

rphmeier
Copy link
Contributor

@rphmeier rphmeier commented Oct 7, 2016

Account storage caches (within the cached account entries) aren't currently configurable, but the jump tables and account cache itself are through the --cache-size-state flag. This will change in a future PR

@rphmeier rphmeier added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. labels Oct 7, 2016
@gavofyork
Copy link
Contributor

looks reasonable

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.06%) to 86.331% when pulling 299ceb8 on canon-cache-size into 4655fd0 on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.07%) to 86.392% when pulling 4276ab8 on canon-cache-size into 72ec936 on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.06%) to 86.395% when pulling 4276ab8 on canon-cache-size into 72ec936 on master.

@gavofyork
Copy link
Contributor

lgtm, but haven't dived deeply into logic. will let @arkpar review before merge.

let cap = jump_dests.capacity();

// grow the cache as necessary; it operates on amount of items
// but we're working based on memory usage.
Copy link
Collaborator

@arkpar arkpar Oct 11, 2016

Choose a reason for hiding this comment

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

Would be better to create an a type of LRUCache that manages that and reuse it for the state cache as well. E.g LRUHeapSizeCache that requires HeapSizeOf. Can be done in a future PR though

Copy link
Contributor Author

@rphmeier rphmeier Oct 11, 2016

Choose a reason for hiding this comment

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

I might make an upstream PR to implement that. Contributing back to the community and all :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've filed an issue at contain-rs/lru-cache#38, I intend to implement and incorporate to the follow-up PR where we'll want this in more than one place.

@@ -211,6 +211,8 @@ usage! {
or |c: &Config| otry!(c.footprint).cache_size_blocks.clone(),
flag_cache_size_queue: u32 = 50u32,
or |c: &Config| otry!(c.footprint).cache_size_queue.clone(),
flag_cache_size_state: u32 = 25u32,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should be at least 64MB by default

Copy link
Contributor Author

@rphmeier rphmeier Oct 12, 2016

Choose a reason for hiding this comment

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

I don't agree. 64MB is quite large and I find that there are diminishing returns after a certain point. With the default size, I find that the heavy blocks only process twice as slowly as with an unrestricted cache.

I think keeping the footprint light by default should be a priority. We want Parity to be able to run on an rPi. Miners have both the resources and the technical knowledge to increase the cache size using the flag.

@arkpar arkpar added A5-grumble 🔥 Pull request has minor issues that must be addressed before merging. and removed A0-pleasereview 🤓 Pull request needs code review. labels Oct 11, 2016
@rphmeier rphmeier added A0-pleasereview 🤓 Pull request needs code review. and removed A5-grumble 🔥 Pull request has minor issues that must be addressed before merging. labels Oct 12, 2016
@arkpar arkpar added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Oct 12, 2016
@rphmeier rphmeier merged commit 4bcc9e3 into master Oct 12, 2016
@gavofyork gavofyork deleted the canon-cache-size branch November 3, 2016 11:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants