-
Notifications
You must be signed in to change notification settings - Fork 192
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 scheduler queue data structures to reduce cache misses and fragmentation #129
Comments
This could be broken down into two issues:
I definitely agree with 1, and could be quickly fixed by implementing a As for 2, I don't disagree, but I've been using various profilers and benchmarks for guidance here. The slow replacement of |
For 2 I was mainly just going off the TODO in the code and have no empirical results yet to show why anything different would be worth it besides the "doing zero work and not thrashing cache is always cheaper than doing any work" :) Part of this would probably be adding more test cases to scheduler_bench.cpp so that we can stress those structures a bit more (in terms of having a large number of waiters, etc). |
From the TODO here:
marl/include/marl/scheduler.h
Lines 283 to 287 in 0591f0e
and this:
marl/include/marl/scheduler.h
Line 436 in 0591f0e
unordered_map and deque aren't great for memory locality and heap fragmentation, and currently these are not using the marl Allocator so they are coming right from the system allocator. It'd be good to evaluate some alternative data structures (adding to or reusing those already in https://github.com/google/marl/blob/master/include/marl/containers.h) and pooling.
The text was updated successfully, but these errors were encountered: