Improve the build performance of mp_find. #99
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This improves the build time by looking up 100 elements in a batch.
Note this is just an optimization. It won't change any observable behavior. In addition, this is disabled for GCC due to a gcc bug.
Tested by creating a list with 996 elements and call mp_find: https://gist.github.com/Mizuchi/fce64eaa400288de136be1181f0edc96
The mp_find_2.cpp build time reduced from 400ms to 80ms.
It's possible to re-implement this with boost.preprocessor to make the batch size (100) configurable, but that will introduce boost.preprocessor as a dependency.