Optimize vectorized sorting - reduce code size, improve speed for large heaps#40613
Merged
PeterSolMS merged 4 commits intodotnet:masterfrom Aug 13, 2020
Merged
Optimize vectorized sorting - reduce code size, improve speed for large heaps#40613PeterSolMS merged 4 commits intodotnet:masterfrom
PeterSolMS merged 4 commits intodotnet:masterfrom
Conversation
|
Tagging subscribers to this area: @dotnet/gc |
Maoni0
reviewed
Aug 12, 2020
| #include <immintrin.h> | ||
| //#include <stdexcept> | ||
| //#include <limits> | ||
| #include <assert.h> |
Member
There was a problem hiding this comment.
any reason to keep these 2 lines?
- remove commented out #include lines - remove unreferenced template specializations for float, double, uint32_t and uint64_t Mitigated trap with our implementation of numeric_limits - make it so we get a compile error when an instantiation of numeric_limits is referenced that is not specialized.
Maoni0
approved these changes
Aug 13, 2020
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
There are two optimizations in this PR:
reduction of code size in the bitonic sorters: by limiting the amount of inlining in this code, we can reduce overall code size in coreclr.dll by about 180 kB.
dynamic packing: during sorting, we can switch to 32-bit sorting as soon as the address range in a partition is less 32 GB. This will only have an impact on large heaps or machines with many processors, because we already have a similar, but static optimization where we use 32-bit sorting if the overall address range in the ephemeral region is less than 32 GB. So this additional optimization will give improvements if the overall address range is greater than 32 GB initially, but becomes less during the sort. In this case, we get about a 1.6x improvement in sorting speed.
cc: @damageboy