Skip to content

Microbenchmarks for Swift -> ObjC string bridging #20364

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 1 commit into from
Nov 7, 2018
Merged

Microbenchmarks for Swift -> ObjC string bridging #20364

merged 1 commit into from
Nov 7, 2018

Conversation

Catfish-Man
Copy link
Contributor

Currently we don't have anything testing these operations, this gets us some simple baseline coverage.

@Catfish-Man Catfish-Man requested a review from milseman November 6, 2018 21:45
@Catfish-Man
Copy link
Contributor Author

@swift-ci please benchmark

@Catfish-Man Catfish-Man self-assigned this Nov 6, 2018
@swift-ci
Copy link
Contributor

swift-ci commented Nov 6, 2018

Build comment file:

Performance: -O

TEST OLD NEW DELTA RATIO
Improvement
FlattenListLoop 4332 3970 -8.4% 1.09x
MapReduceClass2 40 37 -7.5% 1.08x
FlattenListFlatMap 6866 6398 -6.8% 1.07x (?)
MapReduce 425 397 -6.6% 1.07x (?)
Added
ObjectiveCBridgeStringCompare 1281 1508 1357
ObjectiveCBridgeStringCompare2 1240 1301 1261
ObjectiveCBridgeStringGetASCIIContents 647 648 648
ObjectiveCBridgeStringGetUTF8Contents 511 511 511
ObjectiveCBridgeStringHash 156 157 156
ObjectiveCBridgeStringIsEqual 307 316 310
ObjectiveCBridgeStringIsEqual2 1134 1136 1135
ObjectiveCBridgeStringIsEqualAllSwift 981 981 981
ObjectiveCBridgeStringRangeOfString 1222 1280 1242
ObjectiveCBridgeStringUTF8String 358 358 358

Code size: -O

TEST OLD NEW DELTA RATIO
Regression
ObjectiveCTests.o 1902 16305 +757.3% 0.12x
ObjectiveCBridgingStubs.o 9133 18752 +105.3% 0.49x

Performance: -Osize

TEST OLD NEW DELTA RATIO
Improvement
FlattenListLoop 4431 4057 -8.4% 1.09x (?)
Array2D 7206 6611 -8.3% 1.09x
Added
ObjectiveCBridgeStringCompare 1277 1427 1327
ObjectiveCBridgeStringCompare2 1243 1305 1264
ObjectiveCBridgeStringGetASCIIContents 631 632 631
ObjectiveCBridgeStringGetUTF8Contents 511 511 511
ObjectiveCBridgeStringHash 156 158 157
ObjectiveCBridgeStringIsEqual 310 325 315
ObjectiveCBridgeStringIsEqual2 1160 1162 1161
ObjectiveCBridgeStringIsEqualAllSwift 998 999 998
ObjectiveCBridgeStringRangeOfString 1224 1280 1243
ObjectiveCBridgeStringUTF8String 359 360 359

Code size: -Osize

TEST OLD NEW DELTA RATIO
Regression
ObjectiveCTests.o 1902 16305 +757.3% 0.12x
ObjectiveCBridgingStubs.o 8925 17944 +101.1% 0.50x

Performance: -Onone

TEST OLD NEW DELTA RATIO
Regression
UTF8Decode_InitFromData_ascii 721 902 +25.1% 0.80x
Added
ObjectiveCBridgeStringCompare 1282 1422 1329
ObjectiveCBridgeStringCompare2 1241 1309 1264
ObjectiveCBridgeStringGetASCIIContents 641 642 642
ObjectiveCBridgeStringGetUTF8Contents 510 511 511
ObjectiveCBridgeStringHash 156 160 158
ObjectiveCBridgeStringIsEqual 314 315 314
ObjectiveCBridgeStringIsEqual2 1162 1165 1164
ObjectiveCBridgeStringIsEqualAllSwift 999 1000 1000
ObjectiveCBridgeStringRangeOfString 1224 1302 1251
ObjectiveCBridgeStringUTF8String 385 393 388
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

Copy link
Member

@milseman milseman left a comment

Choose a reason for hiding this comment

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

LGTM

@Catfish-Man Catfish-Man merged commit 4db1efa into swiftlang:master Nov 7, 2018
@Catfish-Man Catfish-Man deleted the morestringbridgingbenchmarks branch November 7, 2018 00:21
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.

3 participants