Skip to content

[Gardening] Remove extra Foundation imports #25853

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 2 commits into from
Jul 1, 2019

Conversation

palimondo
Copy link
Contributor

@palimondo palimondo commented Jun 28, 2019

Remove the import of Foundation where it is not necessary for testing the ObjC interoperability.

Edit: Also import MSVCRT in Windows where the #if os(Linux) import Glibc pattern occurs.

Remove the import of Foundation where it is not necessary for testing the ObjC interop.
@palimondo
Copy link
Contributor Author

@swift-ci please benchmark

@palimondo
Copy link
Contributor Author

@swift-ci please smoke test

@palimondo palimondo requested a review from eeckstein June 28, 2019 14:46
@swift-ci
Copy link
Contributor

Performance: -O

Regression OLD NEW DELTA RATIO
FlattenListFlatMap 4062 5313 +30.8% 0.76x (?)
FlattenListLoop 2394 2978 +24.4% 0.80x (?)

Code size: -O

Performance: -Osize

Improvement OLD NEW DELTA RATIO
ArrayAppendGenericStructs 1070 630 -41.1% 1.70x (?)

Code size: -Osize

Performance: -Onone

Improvement OLD NEW DELTA RATIO
ObjectiveCBridgeStubToNSDate2 1040 970 -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 mini
  Model Identifier: Macmini8,1
  Processor Name: 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

@palimondo
Copy link
Contributor Author

Those regressions and improvements in -O and -Osize are unusually high for no changes… Similar to the other case? I wonder if these are flukes or replicable. Re-running benchmark to see.

@jrose-apple
Copy link
Contributor

There are a few things that behave differently based on whether the Foundation overlays are linked into the process. :-( The set is kept pretty small but it could still be an explanation here. cc @Catfish-Man

@palimondo
Copy link
Contributor Author

@swift-ci please benchmark

@swift-ci
Copy link
Contributor

Performance: -O

Improvement OLD NEW DELTA RATIO
FlattenListFlatMap 5734 4378 -23.6% 1.31x (?)
FlattenListLoop 2868 2448 -14.6% 1.17x (?)

Code size: -O

Performance: -Osize

Regression OLD NEW DELTA RATIO
CharIteration_punctuatedJapanese_unicodeScalars 400 440 +10.0% 0.91x (?)
 
Improvement OLD NEW DELTA RATIO
StaticArray 2 1 -50.0% 2.00x

Code size: -Osize

Performance: -Onone

Regression OLD NEW DELTA RATIO
ObjectiveCBridgeStubFromNSDate 2980 3220 +8.1% 0.93x (?)

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: 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

Copy link
Contributor

@eeckstein eeckstein left a comment

Choose a reason for hiding this comment

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

lgtm!
(Please address compnerd's request)

Import functions from standard C library on Windows.
@palimondo
Copy link
Contributor Author

@swift-ci please benchmark

@palimondo
Copy link
Contributor Author

@swift-ci smoke test

@swift-ci
Copy link
Contributor

swift-ci commented Jul 1, 2019

Performance: -O

Regression OLD NEW DELTA RATIO
ObjectiveCBridgeStubFromNSStringRef 87 94 +8.0% 0.93x (?)
ObjectiveCBridgeStubFromNSDateRef 2460 2650 +7.7% 0.93x (?)
 
Improvement OLD NEW DELTA RATIO
FlattenListFlatMap 6339 5471 -13.7% 1.16x (?)

Code size: -O

Performance: -Osize

Regression OLD NEW DELTA RATIO
StringBuilderWithLongSubstring 950 1050 +10.5% 0.90x (?)
 
Improvement OLD NEW DELTA RATIO
SortLettersInPlace 406 378 -6.9% 1.07x (?)

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: 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

@palimondo palimondo merged commit a9eee38 into swiftlang:master Jul 1, 2019
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