-
Notifications
You must be signed in to change notification settings - Fork 441
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
Feature DB File warmer #7050
Feature DB File warmer #7050
Conversation
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.
Interesting. @benaadams something for you to check out too!
long totalSize = 0; | ||
fileMetadatas = fileMetadatas.TakeWhile(metadata => | ||
{ | ||
availableMemory -= (long)metadata.metadata.FileSize; | ||
bool take = availableMemory > 0; | ||
if (take) | ||
{ | ||
totalSize += (long)metadata.metadata.FileSize; | ||
} | ||
return take; | ||
}) | ||
// We reverse them again so that lower level goes last so that it is the freshest. | ||
// Not all of the available memory is actually available so we are probably over reading things. | ||
.Reverse() | ||
.ToList(); |
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.
minor: as fileMetadatas are a List to begin with, instead of TakeWhile, you could just reduce its Count with: https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.collectionsmarshal.setcount?view=net-8.0#system-runtime-interopservices-collectionsmarshal-setcount-1(system-collections-generic-list((-0))-system-int32)
and just reverse, without making another list.
I can confirm that rebooting tanks performance 😉 Then needs a while to brew |
Can confirm this is straight back into good perf after a reboot (this is on top of all the other PRs) |
Perhaps default this to |
Not sure on that. I'm still erring towards |
sudo sysctl -w vm.drop_caches=3
was run between runs.Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Notes on testing