Skip to content

[stdlib] Switch Dictionary.subscript(_:default:) to use _modify #19218

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

Merged

Conversation

airspeedswift
Copy link
Member

Getting rid of another addressor.

@airspeedswift
Copy link
Member Author

@swift-ci please smoke benchmark

@swift-ci
Copy link
Contributor

Build comment file:

Performance: -O

TEST OLD NEW DELTA SPEEDUP
Regression
DictionarySubscriptDefaultMutation 256 294 +14.8% 0.87x
Improvement
DictionarySubscriptDefaultMutationArray 603 557 -7.6% 1.08x

Code size: -O

TEST OLD NEW DELTA SPEEDUP
Regression
DictionarySubscriptDefault.o 23894 24549 +2.7% 0.97x

Performance: -Osize

TEST OLD NEW DELTA SPEEDUP
Regression
DictionaryKeysContainsNative 30 34 +13.3% 0.88x
ObjectiveCBridgeFromNSArrayAnyObjectForced 4756 5244 +10.3% 0.91x (?)
Improvement
DictionarySubscriptDefaultMutationArray 659 593 -10.0% 1.11x

Code size: -Osize

TEST OLD NEW DELTA SPEEDUP
Regression
DictionarySubscriptDefault.o 22366 22813 +2.0% 0.98x

Performance: -Onone

TEST OLD NEW DELTA SPEEDUP
Improvement
DictionaryKeysContainsNative 61 52 -14.8% 1.17x
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

@airspeedswift
Copy link
Member Author

@swift-ci please smoke test

@airspeedswift
Copy link
Member Author

@eeckstein @rjmccall any ideas about the regression in DictionarySubscriptDefaultMutation?

Copy link
Member

@lorentey lorentey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@airspeedswift airspeedswift merged commit 2292df3 into swiftlang:master Sep 11, 2018
@airspeedswift airspeedswift deleted the dictionary-yield-default branch September 11, 2018 21:25
@eeckstein
Copy link
Contributor

I'll take a look

@palimondo
Copy link
Contributor

palimondo commented Oct 3, 2018

@eeckstein, @lorentey I was searching through PRs with benchmarks to see if a regression was caught in DictionarySubscriptDefaultMutation* family of benchmarks. I'm seeing 0.5x slowdown between 2018-09-18 and 2018-10-02 (those were my local build times, I'm not sure if they were synced to the tree at that time) on both O and Onone builds. Have you seen that?

edit: Is this what's being addressed by #19664?

@lorentey
Copy link
Member

lorentey commented Oct 3, 2018

#19664 is an unrelated low-level optimizer issue. We worked around the defaulted subscript regression in #19663.

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.

5 participants