Skip to content

Python3 compatibility for Benchmarks #33039

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
Jul 22, 2020
Merged

Conversation

tbkka
Copy link
Contributor

@tbkka tbkka commented Jul 21, 2020

Three issues addressed here:

  1. Dependency on dictionary iteration order

CharacterProperties.swift.gyb iterated a dictionary to produce its output.
Changed this to a list of tuples to ensure the order is predictable.
Regenerated CharacterProperties.swift to match the new order.

  1. Python3 map returns an iterator, not a list

Changed a bunch of map calls to list(map(...)) to ensure the result is a list

  1. Python3 int() expects a string, won't accept a list of characters

Added a concatenation step that is effectively a no-op on Python2

Three issues addressed here:

1. Dependency on dictionary iteration order

 CharacterProperties.swift.gyb iterated a dictionary to produce its output.
 Changed this to a list of tuples to ensure the order is predictable.

2. Python3 `map` returns an iterator, not a list

 Changed a bunch of `map` calls to `list(map(...))` to ensure the result is a list

3. Python3 `int()` expects a string, won't accept a list of characters

 Added a concatenation step that is effectively a no-op on Python2
@tbkka
Copy link
Contributor Author

tbkka commented Jul 21, 2020

@swift-ci Please smoke test

@tbkka
Copy link
Contributor Author

tbkka commented Jul 21, 2020

@swift-ci Please benchmark

@swift-ci
Copy link
Contributor

Performance: -O

Regression OLD NEW DELTA RATIO
FlattenListFlatMap 3679 4526 +23.0% 0.81x (?)

Code size: -O

Performance: -Osize

Improvement OLD NEW DELTA RATIO
ObjectiveCBridgeStubToNSDate2 360 330 -8.3% 1.09x (?)
ObjectiveCBridgeStubToNSDateRef 2380 2200 -7.6% 1.08x (?)

Code size: -Osize

Performance: -Onone

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 mini
  Model Identifier: Macmini8,1
  Processor Name: 6-Core Intel Core i7
  Processor Speed: 3.2 GHz
  Number of Processors: 1
  Total Number of Cores: 6
  L2 Cache (per Core): 256 KB
  L3 Cache: 12 MB
  Memory: 64 GB

@tbkka
Copy link
Contributor Author

tbkka commented Jul 22, 2020

@swift-ci Please test

@tbkka
Copy link
Contributor Author

tbkka commented Jul 22, 2020

@swift-ci Python lint

@tbkka tbkka merged commit 2c8ae98 into swiftlang:master Jul 22, 2020
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