Skip to content

Make empty dictionary and set literals use the singleton #22527

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
merged 5 commits into from
Feb 12, 2019

Conversation

Catfish-Man
Copy link
Contributor

@Catfish-Man Catfish-Man commented Feb 11, 2019

rdar://problem/34740754 let foo: [Int: String] = [:] allocates storage for empty dictionary

@Catfish-Man
Copy link
Contributor Author

@swift-ci please benchmark

@Catfish-Man Catfish-Man self-assigned this Feb 11, 2019
@Catfish-Man Catfish-Man requested a review from lorentey February 11, 2019 23:39
@Catfish-Man
Copy link
Contributor Author

@swift-ci please benchmark

@Catfish-Man
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 2a9aa16

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.

Extremely approved!

@Catfish-Man Catfish-Man changed the title Make empty dictionary literals use the singleton Make empty dictionary and set literals use the singleton Feb 11, 2019
@Catfish-Man
Copy link
Contributor Author

@swift-ci please benchmark

@Catfish-Man
Copy link
Contributor Author

@swift-ci please benchmark

@Catfish-Man
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - bf09c28

@airspeedswift
Copy link
Member

there should be a facepalm GitHub reaction...

@Catfish-Man
Copy link
Contributor Author

@swift-ci please benchmark

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 2a9aa16

@swift-ci
Copy link
Contributor

Performance: -O

TEST OLD NEW DELTA RATIO
Improvement
NSDictionaryCastToSwift 4080 2310 -43.4% 1.77x
DataAppendDataLargeToLarge 50800 37200 -26.8% 1.37x (?)

Code size: -O

TEST OLD NEW DELTA RATIO
Regression
DictionaryKeysContains.o 9903 10751 +8.6% 0.92x
DictionaryLiteral.o 1360 1392 +2.4% 0.98x

Performance: -Osize

TEST OLD NEW DELTA RATIO
Improvement
NSDictionaryCastToSwift 4070 2310 -43.2% 1.76x
ObjectiveCBridgeStubFromNSDateRef 4480 4080 -8.9% 1.10x (?)

Code size: -Osize

TEST OLD NEW DELTA RATIO
Regression
DictionaryKeysContains.o 7655 8103 +5.9% 0.94x

Performance: -Onone

TEST OLD NEW DELTA RATIO
Improvement
NSDictionaryCastToSwift 5320 3400 -36.1% 1.56x
Dictionary3 707 614 -13.2% 1.15x
CharIndexing_punctuatedJapanese_unicodeScalars 113200 99200 -12.4% 1.14x (?)
CharIndexing_russian_unicodeScalars 542400 477320 -12.0% 1.14x (?)
CharIndexing_tweet_unicodeScalars 1278200 1129480 -11.6% 1.13x (?)
CharIndexing_japanese_unicodeScalars 777520 688520 -11.4% 1.13x (?)
Histogram 9413 8414 -10.6% 1.12x (?)
DataAppendArray 5700 5100 -10.5% 1.12x (?)
CharIndexing_korean_unicodeScalars 622080 558320 -10.2% 1.11x (?)
CharIndexing_ascii_unicodeScalars 628840 566440 -9.9% 1.11x (?)
CharIndexing_chinese_unicodeScalars 476400 436640 -8.3% 1.09x (?)
CharIndexing_punctuated_unicodeScalars 136560 125200 -8.3% 1.09x (?)
CharIndexing_utf16_unicodeScalars 555440 515880 -7.1% 1.08x (?)
NormalizedIterator_fastPrenormal 1630 1520 -6.7% 1.07x (?)
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

@Catfish-Man
Copy link
Contributor Author

@swift-ci please smoke test and merge

1 similar comment
@Catfish-Man
Copy link
Contributor Author

@swift-ci please smoke test and merge

@Catfish-Man
Copy link
Contributor Author

@swift-ci please smoke test and merge

1 similar comment
@Catfish-Man
Copy link
Contributor Author

@swift-ci please smoke test and merge

@swift-ci swift-ci merged commit 498b722 into swiftlang:master Feb 12, 2019
@Catfish-Man Catfish-Man deleted the literally-empty branch February 12, 2019 06:41
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.

4 participants