Skip to content
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

Skip compilation when there's no code changes #296

Open
amomchilov opened this issue Nov 3, 2024 · 2 comments
Open

Skip compilation when there's no code changes #296

amomchilov opened this issue Nov 3, 2024 · 2 comments

Comments

@amomchilov
Copy link

Hey there,

It looks like the plugin does a full rebuild on every command, even when no code has changed. E.g. on the sample project, running swift package benchmark baseline list takes ~30 seconds, even on a repeated invocation.

$ time swift package benchmark baseline list
Building for debugging...
[1/1] Write swift-version--58304C5D6DBC2206.txt
Build of product 'BenchmarkBoilerplateGenerator' complete! (0.66s)
Building for debugging...
[1/1] Write swift-version--58304C5D6DBC2206.txt
Build of product 'BenchmarkBoilerplateGenerator' complete! (0.12s)
Building for debugging...
[1/1] Write swift-version--58304C5D6DBC2206.txt
Build of product 'BenchmarkBoilerplateGenerator' complete! (0.12s)
Building for debugging...
[1/1] Write swift-version--58304C5D6DBC2206.txt
Build of product 'BenchmarkBoilerplateGenerator' complete! (0.11s)
Building for debugging...
[1/1] Write swift-version--58304C5D6DBC2206.txt
Build of product 'BenchmarkBoilerplateGenerator' complete! (0.12s)
Building for debugging...
[1/1] Write swift-version--58304C5D6DBC2206.txt
Build of product 'BenchmarkBoilerplateGenerator' complete! (0.12s)
Building for debugging...
[1/1] Write swift-version--58304C5D6DBC2206.txt
Build of product 'BenchmarkBoilerplateGenerator' complete! (0.12s)
Building for debugging...
[1/1] Write swift-version--58304C5D6DBC2206.txt
Build of product 'BenchmarkTool' complete! (1.83s)
Building benchmark targets in release mode for benchmark run...
Building Samples
Building Miscellaneous
Building Minimal
Building MemoryTwo
Building MemoryOne
Building Foundation-Benchmark
Building External-Benchmarks
Build complete!
swift package benchmark baseline list  45.83s user 4.07s system 160% cpu 31.024 total

I'd be happy to contribute to fixing this, if you could point me in the right directiont ot start.

@MahdiBM
Copy link
Contributor

MahdiBM commented Nov 3, 2024

I wonder if a --skip-build flag can be of use, it can be directly passed to swift build by the benchmarking package.
I think It'll be valuable ... we can skip some CI time when we know that we have build the package in the previous step and there are no changes.

@hassila
Copy link
Contributor

hassila commented Nov 7, 2024

Yeah, this is frustrating - I believe this is a possible workaround as pointed out by @MahdiBM :

swiftlang/swift-package-manager#7210 (comment)

(that case is about this specific problem, there should be no rebuild really - if that SPM case is fixed, it should "just work" AFAICT)

Having a skip flag is problematic, as the discovery of the benchmarks are done using the SPM API (we get the path to the executables from there).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants