Skip to content

Conversation

@Catfish-Man
Copy link
Contributor

No description provided.

@Catfish-Man
Copy link
Contributor Author

Notes to myself for if/when I get back to this:
• investigate using memmem instead of boyer-moore
• see if you can find a better sparse array type than "Dictionary" for the skip table
• need lots of tests to make sure we handle things like normalization the same way Cocoa does
• probably want to get at least the simple cases of -rangeOfString:options:, rangeOfString:options:range:, and -rangeOfString:options:range:locale:, just so there aren't mysterious performance cliffs
• do -rangeOfCharacterFromSet* and -rangeOfComposedCharacterSequence* too?
• benchmarks obviously

@Catfish-Man Catfish-Man force-pushed the chef-boyar-moore-dee branch from e3de625 to d4eb173 Compare August 7, 2021 20:59
@Catfish-Man
Copy link
Contributor Author

@swift-ci please test

@Catfish-Man
Copy link
Contributor Author

@swift-ci please benchmark

@swift-ci
Copy link
Contributor

swift-ci commented Aug 8, 2021

Build failed before running benchmark.

@swift-ci
Copy link
Contributor

swift-ci commented Aug 8, 2021

Build failed
Swift Test OS X Platform
Git Sha - 3378d48

@swift-ci
Copy link
Contributor

swift-ci commented Aug 8, 2021

Build failed
Swift Test Linux Platform
Git Sha - 3378d48

@Catfish-Man
Copy link
Contributor Author

@swift-ci please clean smoke test

@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

swift-ci commented Aug 9, 2021

Performance (x86_64): -O

Regression OLD NEW DELTA RATIO
ObjectiveCBridgeStringRangeOfString 1148 7769 +576.7% 0.15x
DictionaryOfAnyHashableStrings_insert 3052 5572 +82.6% 0.55x
Set.isDisjoint.Box25 355 505 +42.3% 0.70x (?)
Set.isDisjoint.Int50 263 336 +27.8% 0.78x (?)
Set.isDisjoint.Int25 268 341 +27.2% 0.79x (?)
String.data.Medium 96 122 +27.1% 0.79x (?)
DictionaryKeysContainsNative 21 26 +23.8% 0.81x (?)
String.data.Small 43 52 +20.9% 0.83x (?)
StringRemoveDupes 266 297 +11.7% 0.90x (?)
 
Improvement OLD NEW DELTA RATIO
StringFromLongWholeSubstring 5 4 -20.0% 1.25x
UTF8Decode_InitFromCustom_noncontiguous_ascii 1022 938 -8.2% 1.09x (?)
ObjectiveCBridgeFromNSSetAnyObject 37800 35200 -6.9% 1.07x (?)

Code size: -O

Performance (x86_64): -Osize

Regression OLD NEW DELTA RATIO
ObjectiveCBridgeStringRangeOfString 1153 7757 +572.8% 0.15x
 
Improvement OLD NEW DELTA RATIO
StringFromLongWholeSubstring 5 4 -20.0% 1.25x
DictionaryKeysContainsNative 28 25 -10.7% 1.12x (?)

Code size: -Osize

Performance (x86_64): -Onone

Regression OLD NEW DELTA RATIO
ObjectiveCBridgeStringRangeOfString 1145 7747 +576.6% 0.15x
 
Improvement OLD NEW DELTA RATIO
ParseInt.UIntSmall.Binary 11751 10196 -13.2% 1.15x (?)
ParseInt.UInt64.Decimal 3272 2915 -10.9% 1.12x (?)
DataCreateMediumArray 7080 6360 -10.2% 1.11x (?)
LineSink.scalars.alpha 353 321 -9.1% 1.10x (?)
DataAppendDataMediumToMedium 5120 4780 -6.6% 1.07x (?)

Code size: -swiftlibs

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 
@swift-ci
Copy link
Contributor

swift-ci commented Aug 9, 2021

Build failed
Swift Test Linux Platform
Git Sha - 0bbd08a

@Catfish-Man
Copy link
Contributor Author

LOL well that needs some optimization. Glad we have benchmark coverage

@Catfish-Man
Copy link
Contributor Author

@swift-ci Apple Silicon benchmark

@Catfish-Man
Copy link
Contributor Author

Just out of curiosity

@swift-ci
Copy link
Contributor

swift-ci commented Aug 9, 2021

Build failed
Swift Test OS X Platform
Git Sha - 0bbd08a

@Catfish-Man
Copy link
Contributor Author

@swift-ci please smoke benchmark

@swift-ci
Copy link
Contributor

Performance (x86_64): -O

Regression OLD NEW DELTA RATIO
BridgeString.find.native.long 516 6398 +1139.9% 0.08x
BridgeString.find.native 61 622 +919.7% 0.10x
BridgeString.find.native.longNonASCII 746 6383 +755.6% 0.12x
ObjectiveCBridgeStringRangeOfString 1146 7796 +580.3% 0.15x
BridgeString.find.native.longBoth 408 1628 +299.0% 0.25x
Set.isDisjoint.Int50 262 336 +28.2% 0.78x (?)
Set.isDisjoint.Int25 268 341 +27.2% 0.79x (?)
String.data.Small 43 52 +20.9% 0.83x (?)
DictionaryKeysContainsNative 21 25 +19.0% 0.84x (?)
StringRemoveDupes 264 296 +12.1% 0.89x (?)
ObjectiveCBridgeToNSDictionary 15500 16950 +9.4% 0.91x (?)
SetSubtractingInt50 110 119 +8.2% 0.92x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 34400 37200 +8.1% 0.92x (?)
 
Improvement OLD NEW DELTA RATIO
StringFromLongWholeSubstring 5 4 -20.0% 1.25x (?)
ArrayAppendGenericStructs 2440 2030 -16.8% 1.20x (?)
UTF8Decode_InitDecoding_ascii 279 240 -14.0% 1.16x (?)
UTF8Decode_InitFromCustom_contiguous_ascii 281 246 -12.5% 1.14x (?)
StringToDataMedium 3400 3150 -7.4% 1.08x (?)

Code size: -O

Performance (x86_64): -Osize

Regression OLD NEW DELTA RATIO
BridgeString.find.native.long 516 6431 +1146.3% 0.08x
BridgeString.find.native 61 626 +926.2% 0.10x
BridgeString.find.native.longNonASCII 746 6445 +763.9% 0.12x
ObjectiveCBridgeStringRangeOfString 1149 7762 +575.5% 0.15x
BridgeString.find.native.longBoth 409 1636 +300.0% 0.25x
String.data.Small 43 53 +23.3% 0.81x (?)
String.data.Medium 103 120 +16.5% 0.86x (?)
FlattenListFlatMap 6110 6937 +13.5% 0.88x (?)
String.data.LargeUnicode 107 120 +12.1% 0.89x (?)
PrefixAnySequenceLazy 1596 1718 +7.6% 0.93x (?)
 
Improvement OLD NEW DELTA RATIO
StringFromLongWholeSubstring 5 4 -20.0% 1.25x
DropLastAnyCollectionLazy 30604 28423 -7.1% 1.08x (?)
SubstringEqualString 444 413 -7.0% 1.08x (?)

Code size: -Osize

Performance (x86_64): -Onone

Regression OLD NEW DELTA RATIO
BridgeString.find.native.long 516 6396 +1139.5% 0.08x
BridgeString.find.native 61 626 +926.2% 0.10x
BridgeString.find.native.longNonASCII 746 6404 +758.4% 0.12x
ObjectiveCBridgeStringRangeOfString 1150 7728 +572.0% 0.15x
BridgeString.find.native.longBoth 409 1631 +298.8% 0.25x
 
Improvement OLD NEW DELTA RATIO
ParseInt.UIntSmall.Binary 11777 10243 -13.0% 1.15x (?)
StringToDataMedium 7200 6350 -11.8% 1.13x (?)
ParseInt.UInt64.Decimal 3255 2934 -9.9% 1.11x (?)
ParseInt.UInt64.Hex 3268 2950 -9.7% 1.11x (?)
PrefixAnyCollectionLazy 166896 154422 -7.5% 1.08x (?)
BridgeString.find.native.nonASCII 539 503 -6.7% 1.07x (?)

Code size: -swiftlibs

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 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants