-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
Conversation
@swift-ci benchmark. |
Build failed before running benchmark. |
@swift-ci benchmark |
Build failed before running benchmark. |
@swift-ci benchmark |
Performance: -Osize
How to read the dataThe 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 Noise: Sometimes the performance results (not code size!) contain false Hardware Overview
|
@swift-ci test. |
@gottesmm I'm done with these cmake fixes. I didn't do any auxiliary cleanup. It should be trivial to review. |
Build failed |
Build failed |
There was a problem hiding this 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") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice warning!
benchmark/README.md
Outdated
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` |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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?
@gottesmm Getting all the right behavior without adding a new option was too tricky. So now we have 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. |
@swift-ci benchmark |
No performance and code size changes |
message("-- SWIFT_LIBRARY_PATH = ${SWIFT_LIBRARY_PATH}") | ||
message("-- CLANG_EXEC = ${CLANG_EXEC}") | ||
if (SWIFT_RPATH_BASE) |
There was a problem hiding this comment.
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.
@swift-ci benchmark |
@swift-ci test |
Build failed |
@swift-ci benchmark |
@swift-ci benchmark benchmark benchmark |
@swift-ci test |
@swift-ci benchmark |
@swift-ci test OSX platform |
Build failed |
@swift-ci test OS X |
Performance: -O
How to read the dataThe 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 Noise: Sometimes the performance results (not code size!) contain false Hardware Overview
|
And fix the SWIFT_LIBRARY_PATH option so that it also sets the
RPATH.