Skip to content

Conversation

@davecgh
Copy link
Member

@davecgh davecgh commented Jun 10, 2024

This requires #3359.

This consists of a series of commits to update the code to make use of the new container/lru module as well as deprecate and remove the existing interface-based lru module.

In addition to being a bit more efficient, it also has the benefit of using the expiration functionality the new module provides to impose an expiration time of 15 minutes on the known inventory entries for peers. This allows the possibility of the cache shrinking over time in periods of low activity versus the current behavior where it will eventually reach the limit and stay there indefinitely.

Each commit is intended to be a self-contained and logically easy to follow change such that the code continues to compile and the tests continue to pass at each step.

See the description of each commit for further details.

@davecgh davecgh added this to the 2.1.0 milestone Jun 10, 2024
@davecgh davecgh force-pushed the multi_use_container_lru branch 2 times, most recently from 5184989 to e0450ca Compare June 10, 2024 03:52
@davecgh davecgh marked this pull request as draft June 10, 2024 03:54
@davecgh davecgh force-pushed the multi_use_container_lru branch 2 times, most recently from 6f35e11 to 28a2817 Compare June 10, 2024 16:04
@davecgh davecgh force-pushed the multi_use_container_lru branch 2 times, most recently from f975d1f to 19f444d Compare June 11, 2024 23:24
@davecgh davecgh force-pushed the multi_use_container_lru branch 2 times, most recently from 2211fb9 to 607a7cd Compare June 12, 2024 17:08
@davecgh davecgh marked this pull request as ready for review June 12, 2024 17:08
@davecgh davecgh force-pushed the multi_use_container_lru branch 4 times, most recently from 51741bf to c95a209 Compare June 12, 2024 23:05
davecgh added 6 commits June 13, 2024 15:47
This updates the peer known inventory and sent nonces LRU caches to use
the new container/lru module.

It also uses the expiration functionality of the new module to impose an
expiration time of 15 minutes on the known inventory entries.  This will
allow the possibility of the cache shrinking over time in periods of low
activity versus the current behavior where it will eventually reach the
limit and stay there indefinitely.
This updates the blockchain recent blocks and contextual checks LRU
caches to use the new container/lru module.
This updates the mining notified parents LRU cache to use the new
container/lru module.
This adds the new container/lru module to the multimod go workspace
setup script and simultaneously removes the old lru module.

It also adds a directive to drop the use of the old lru module from
existing go.work files.
@davecgh davecgh force-pushed the multi_use_container_lru branch from c95a209 to 6ac5ab5 Compare June 13, 2024 20:47
@davecgh davecgh merged commit 6ac5ab5 into decred:master Jun 13, 2024
@davecgh davecgh deleted the multi_use_container_lru branch June 13, 2024 20:50
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