Skip to content

Benchmark cmake: Allow building from a Swift root. #23814

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
Apr 10, 2019
Merged

Benchmark cmake: Allow building from a Swift root. #23814

merged 1 commit into from
Apr 10, 2019

Conversation

atrick
Copy link
Contributor

@atrick atrick commented Apr 5, 2019

And fix the SWIFT_LIBRARY_PATH option so that it also sets the
RPATH.

@atrick
Copy link
Contributor Author

atrick commented Apr 5, 2019

@swift-ci benchmark.

@atrick atrick requested a review from gottesmm April 5, 2019 16:46
@swift-ci
Copy link
Contributor

swift-ci commented Apr 5, 2019

Build failed before running benchmark.

@atrick
Copy link
Contributor Author

atrick commented Apr 5, 2019

@swift-ci benchmark

@swift-ci
Copy link
Contributor

swift-ci commented Apr 5, 2019

Build failed before running benchmark.

@atrick
Copy link
Contributor Author

atrick commented Apr 5, 2019

@swift-ci benchmark

@swift-ci
Copy link
Contributor

swift-ci commented Apr 6, 2019

Performance: -Osize

TEST OLD NEW DELTA RATIO
Improvement
ObjectiveCBridgeStubFromNSDateRef 4390 4050 -7.7% 1.08x (?)
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

@atrick
Copy link
Contributor Author

atrick commented Apr 6, 2019

@swift-ci test.

@atrick
Copy link
Contributor Author

atrick commented Apr 6, 2019

@gottesmm I'm done with these cmake fixes. I didn't do any auxiliary cleanup. It should be trivial to review.

@swift-ci
Copy link
Contributor

swift-ci commented Apr 6, 2019

Build failed
Swift Test Linux Platform
Git Sha - ab24cae1b990cddb87a62a608a881aec24d7ccda

@swift-ci
Copy link
Contributor

swift-ci commented Apr 6, 2019

Build failed
Swift Test OS X Platform
Git Sha - ab24cae1b990cddb87a62a608a881aec24d7ccda

Copy link
Contributor

@gottesmm gottesmm left a comment

Choose a reason for hiding this comment

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

Some quick questions. Then I want to look one more time.

endif()
if (SWIFT_RPATH)
message("-- SWIFT_RPATH = ${SWIFT_RPATH}")
message("--- ** WARNING ** Benchmarking against Swift-in-the-OS")
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice warning!

the performance of the Swift standard library installed on the hosts,
not the one included in the Swift root. This could be built as such:

cmake .. -G Ninja -DSWIFT_DARWIN_XCRUN_TOOLCHAIN=XcodeDefault -DSWIFT_EXEC=`xcrun --toolchain XcodeDefault --find swiftc`
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you document SWIFT_DARWIN_XCRUN_TOOLCHAIN above?

I almost wonder if it would make sense to have a separate section for building against Swift-in-the-OS? Your thoughts?

set(SWIFT_LIBRARY_PATH "${tmp_dir}/lib/swift")
# Check if SWIFT_EXEC is from a build vs. install path.
set(SWIFT_EXEC_INSTALLED FALSE)
if(SWIFT_BENCHMARK_BUILT_STANDALONE AND NOT EXISTS "${SWIFT_EXEC}../lib/swift/${BENCH_COMPILE_ARCHOPTS_PLATFORM}/Swift.swiftmodule")
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this correct? Shouldn't SWIFT_EXEC have a / after? Also, TBH, why shouldn't SWIFT_BENCHMARK_BUILT_STANDALONE just imply this?

@atrick
Copy link
Contributor Author

atrick commented Apr 9, 2019

@gottesmm Getting all the right behavior without adding a new option was too tricky. So now we have
SWIFT_BENCHMARK_USE_OS_LIBRARIES, and no weird inference during configuration.

There's nothing we can really infer from the SWIFT_BENCHMARK_BUILT_STANDALONE flag, except that SWIFT_LIBRARY_PATH was not already set by the LLVM config.

@atrick
Copy link
Contributor Author

atrick commented Apr 9, 2019

@swift-ci benchmark

@swift-ci
Copy link
Contributor

swift-ci commented Apr 9, 2019

No performance and code size changes

message("-- SWIFT_LIBRARY_PATH = ${SWIFT_LIBRARY_PATH}")
message("-- CLANG_EXEC = ${CLANG_EXEC}")
if (SWIFT_RPATH_BASE)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add a top-level comment explaining what an rpath base is

Cleanup and document the configuration of the library path and rpath.

With SWIFT_BENCHMARK_USE_OS_LIBRARIES, it's now possible to directly
build benchmarks for a target device and run those benchmarks on the
device without building or installing Swift.

It's also possible now to specify an absolute SWIFT_LIBRARY_PATH to be
used as an rpath so installation can be skipped.
@atrick
Copy link
Contributor Author

atrick commented Apr 10, 2019

@swift-ci benchmark

@atrick
Copy link
Contributor Author

atrick commented Apr 10, 2019

@swift-ci test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - c2b9f84638876398ffc2b344857a908333960528

@atrick
Copy link
Contributor Author

atrick commented Apr 10, 2019

@swift-ci benchmark

@atrick
Copy link
Contributor Author

atrick commented Apr 10, 2019

@swift-ci benchmark benchmark benchmark

@atrick
Copy link
Contributor Author

atrick commented Apr 10, 2019

@swift-ci test

@atrick
Copy link
Contributor Author

atrick commented Apr 10, 2019

@swift-ci benchmark

@atrick
Copy link
Contributor Author

atrick commented Apr 10, 2019

@swift-ci test OSX platform

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - e622103c86110efa6bb1985ade947d22ba4943d2

@atrick
Copy link
Contributor Author

atrick commented Apr 10, 2019

@swift-ci test OS X

@swift-ci
Copy link
Contributor

Performance: -O

TEST OLD NEW DELTA RATIO
Regression
DataAppendDataLargeToLarge 36600 50400 +37.7% 0.73x (?)
ObjectiveCBridgeStubFromNSStringRef 167 184 +10.2% 0.91x (?)
Improvement
ObjectiveCBridgeStubToNSDate2 1400 1220 -12.9% 1.15x (?)
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

@atrick atrick merged commit 43f9df2 into swiftlang:master Apr 10, 2019
@atrick atrick deleted the benchmark-cmake branch May 8, 2019 21:35
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