Skip to content

Update benchmark readme with info on how to ensure benchmarks test locally built stdlib #79528

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 6 commits into from
Feb 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ installed libraries instead, enable
This will reflect the performance of the Swift standard library
installed on the device, not the one included in the Swift root.

If a build fails with an error like `cannot find X in scope`, it may be because
default toolchains don't give access to stdlib SPI. Try using a dev toolchain
built locally or a dev snapshot from
[Swift.org](https://www.swift.org/install/).

### build-script using SwiftPM+LLBuild

To build the benchmarks using build-script/swiftpm, one must build both
Expand Down Expand Up @@ -148,6 +153,15 @@ swift-source/swift/benchmark$ .build/release/SwiftBench
...
```

### Troubleshooting

* To check what libraries benchmark is linked against, set the
`DYLD_PRINT_SEARCHING` environment variable. E.g.
`export DYLD_PRINT_SEARCHING=1`.
* To force linking with a locally built stdlib, use the `DYLD_LIBRARY_PATH`
environment variable. E.g. `export
DYLD_LIBRARY_PATH=<path_to_build_folder>/Ninja-ReleaseAssert/swift-macosx-x86_64/lib/swift/macosx/x86_64`.

## Editing in Xcode

It is now possible to work on swiftpm benchmarks in Xcode! This is done by using
Expand Down