-
Notifications
You must be signed in to change notification settings - Fork 520
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Class] Sort our array of Class -> token references so that we can do…
… binary instead of linear searches in it. (#5009) Our type map has two sections: first come all the wrapper types, then all the custom types. This means we need to sort these two sections separately, since code elsewhere depends on this split in order to determine if a type is a custom type or not. We also need a minor modification in the array of skipped types, since it contained indexes into the type map, which won't be valid after is has been sorted. Instead store a type reference for the actual type in the array, and use that to search the type map for the corresponding Class. This is a little bit slower, but the results are cached in a dictionary, so it'll only happen once for each type. The performance is slightly slower when the type map has very few entries, but that is repaid many times over when the number of entries go up. Numbers ======= Test case: rolfbjarne/TestApp@004283d iPad Air 2 ---------- | Configuration | Before | After | Improvement | | ------------------- | ------ | ------ | ------------: | | Release (link all) | 477 ms | 481 ms | -4 ms (-0,8%) | | Release (dont link) | 738 ms | 656 ms | 82 ms (11%) | iPhone X -------- | Configuration | Before | After | Improvement | | ------------------- | ------ | ------ | ----------: | | Release (link all) | 98 ms | 99 ms | -1 ms (-1%) | | Release (dont link) | 197 ms | 153 ms | 44 ms (22%) | When linking all assemblies, the type map has 24 entries, and when not linking at all it has 2993 entries. This is part 1 of multiple fixes for #4936.
- Loading branch information
1 parent
1ec90f0
commit 900356c
Showing
5 changed files
with
57 additions
and
29 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
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
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
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
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
900356c
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.
✅ Jenkins job (on internal Jenkins) succeeded
✅ Build succeeded
✅ API Diff (from stable)
ℹ️ API Diff (from PR only) (please review changes)
✅ Generator Diff (no change)
✅ Test run succeeded