-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Micro-optimize PFR fields detection (#188)
* Start upper bound fields search from `4` fields, to avoid slow startup on typical workloads * Inline the `fields_count_binary_search_unbounded` function to reduce template instantiations depth by 1 * Renamed `min` to `min_of_size_t` to avoid weired syntax * Applied idea of better error reporting from #120 * Do not start fields count computation if one of the static asserts failed. That speedups error reporting in edge cases * Use `std::*_t` versions of traits as they are faster in some implementations * Rewrite binary search to simplify it and to avoid degradation to linear search on types that have constructor from variadic pack * Remove default template parameters to simplify code As a result, the whole test suite now runs 10%-25% faster on MSVC, ~20% faster on Clang, and 7%-20% faster on GCC.
- Loading branch information
Showing
1 changed file
with
80 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters