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

Optimize LFU maintenance #530

Closed
wants to merge 8 commits into from
Closed

Optimize LFU maintenance #530

wants to merge 8 commits into from

Conversation

bitfaster
Copy link
Owner

@bitfaster bitfaster commented Dec 4, 2023

Apply [MethodImplOptions.AggressiveOptimization]. This was introduced in .NET Core 3.0, to avoid conditional compile just cast 512 to the enum type which is ignored on earlier versions of .NET.

Dynamic PGO on newer frameworks tends not to optimize the maintenance workload because it doesn't execute on the hot path. This reduces throughput when the cache is contended.

@coveralls
Copy link

coveralls commented Dec 4, 2023

Coverage Status

coverage: 99.179% (+0.05%) from 99.127%
when pulling 173645a on users/alexpeck/opt2
into 80ba526 on main.

@bitfaster
Copy link
Owner Author

bitfaster commented May 17, 2024

Not able to measure any gain from this on windows or mac, for .Net6 or .net8. Likely the change for the ConcurrentLruCore struct to be embedded/inlined into the parent class eliminated any gain we might see from this.

net6base.zip
net6opt.zip
net8base.zip
net8opt.zip
data - mac.zip
WinCompare.xlsx

@bitfaster bitfaster closed this May 17, 2024
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.

None yet

2 participants