Skip to content
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

[stdlib] Set, Dictionary: force-inline native iterators #19684

Merged
merged 2 commits into from
Oct 3, 2018

Conversation

lorentey
Copy link
Member

@lorentey lorentey commented Oct 3, 2018

This is an experimental change. While looking at generated code, I noticed some inefficiencies that would be fixed by inlining the native next().

This PR currently also inlines the top-level iterator entry points; however, that may have an adverse effect on code size, so I may need to remove that.

@lorentey
Copy link
Member Author

lorentey commented Oct 3, 2018

@swift-ci smoke test

@lorentey
Copy link
Member Author

lorentey commented Oct 3, 2018

@swift-ci smoke benchmark

@swift-ci
Copy link
Contributor

swift-ci commented Oct 3, 2018

Build comment file:

Code size: -O

TEST OLD NEW DELTA RATIO
Improvement
DictionaryKeysContains.o 18963 18179 -4.1% 1.04x

Code size: -Osize

TEST OLD NEW DELTA RATIO
Improvement
DictionaryKeysContains.o 16859 16011 -5.0% 1.05x
DictionaryBridgeToObjC.o 6917 6749 -2.4% 1.02x
How to read the data The tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.

If you see any unexpected regressions, you should consider fixing the regressions before you merge the PR.

Noise: Sometimes the performance results (not code size!) contain false alarms. Unexpected regressions which are marked with '(?)' are probably noise. If you see regressions which you cannot explain you can try to run the benchmarks again. If regressions still show up, please consult with the performance team (@eeckstein).

Hardware Overview
  Model Name: Mac Pro
  Model Identifier: MacPro6,1
  Processor Name: 12-Core Intel Xeon E5
  Processor Speed: 2.7 GHz
  Number of Processors: 1
  Total Number of Cores: 12
  L2 Cache (per Core): 256 KB
  L3 Cache: 30 MB
  Memory: 64 GB

@lorentey
Copy link
Member Author

lorentey commented Oct 3, 2018

Ah, this turned out to be a code size win, but performance improvements are below the threshold.

I'll take it!

@lorentey lorentey merged commit 6b2d65e into swiftlang:master Oct 3, 2018
@lorentey lorentey deleted the force-inline-native-iterators branch October 3, 2018 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants