Commit Graph

47 Commits

Author SHA1 Message Date
Pavol Vaskovic
0438c45e2d [benchmark] B_D iterations => independent-samples
Renamed Benchmark_Driver’s `iterations` argument to `independent-samples` to clarify its true meaning and  disambiguate it from the concept of `num-iters` used in Benchmark_O. The short form of the argument — `-i` — remains unchanged.
2018-10-11 18:56:27 +02:00
Graydon Hoare
94725dff2b [benchmark] Add preliminary helper for measuring instructions executed. 2018-08-25 01:29:37 -07:00
Erik Eckstein
13aae18d55 benchmarks: fix the cmake code to detect if SWIFT_EXEC supports the -align-module-to-page-size option.
This check should only be done for pre-built compilers.
2018-08-22 09:58:20 -07:00
Erik Eckstein
1a161c28ae benchmarks: compile with the new -align-module-to-page-size option, if supported by the compiler
To stabilize the benchmark results.
2018-07-27 17:15:14 -07:00
Michael Gottesman
36e0e6949c [benchmark] Add cmake support for compiling the benchmarks standalone on Linux.
To use this, one needs to first build an installable root for swift (i.e. like
the smoke testbot does). Then use the tool ./benchmark/scripts/build_linux.py
with the appropriate locations of the build-directory, installable snapshot,
and it will build the benchmarks. (There are more arguments, just use --help).

rdar://40541972
2018-05-29 14:25:16 -07:00
Michael Gottesman
9740bef838 [benchmark] Move build configuration/sdk configuration out of the main CMakeLists.txt file into AddSwiftBenchmarkSuite.cmake.
I am going to add some support here for Linux. I want to make sure that these
changes are hidden from the main CMakeLists.txt file since we want that file to
be as declarative as possible.

rdar://40541972
2018-05-28 18:39:43 -07:00
Michael Gottesman
09e1e20546 [benchmark][cmake] Move runcmd from AddSwiftBench* => SwiftBenchmarkUtils.cmake.
A quick NFC cleanup that I saw.

rdar://40541972
2018-05-24 18:15:33 -07:00
Andrew Trick
3715464c05 Add a cmake flag to the benchmarks: SWIFT_BENCHMARK_EXTRA_FLAGS.
We used to have this cmake flag but it seems to have disappeared. Building the
benchmarks with different swiftc flags is central to performance analysis, so
I'm not sure how people were getting this done.
2018-03-05 12:24:38 -08:00
Ben Cohen
3b4eacc3a8 Update benchmarks to Swift 4 (#14623) 2018-02-14 17:26:58 -08:00
Adam Nemet
80c9b044f6 Support opt-viewer when benchmarking in stand-alone mode
Tested locally with both stand-alone and in-tree benchmarking.
2017-12-13 21:19:22 -08:00
Adam Nemet
30cbf7e9e5 Support opt-viewer with multi-source benchmarks as well 2017-12-11 22:06:53 -08:00
Adam Nemet
7ed42f3963 Generate opt-view for benchmarks
When the SWIFT_BENCHMARK_GENERATE_OPT_VIEW cmake flag is on, the benchmarks are
compiled with -save-optimization-record which generate optimization remarks in
external YAML files. Then the opt-viewer tool from LLVM is invoked to generate
the HTML pages that displays the remarks embedded in the source code.

I've only added it to single-source benchmarks for now.

This can be enabled by
passing --extra-cmake-options='-DSWIFT_BENCHMARK_GENERATE_OPT_VIEW=ON' to
build-script.
2017-12-01 08:51:46 -08:00
Erik Eckstein
45a2ae48ce benchmarks: replace the Ounchecked build with an Osize build
We don't measure Ounchecked anymore. On the other hand we want to benchmark the Osize build.
2017-10-06 14:09:43 -07:00
Michael Gottesman
48f4a276ba [benchmark] Only add -external suffix to targets in standalone builds where SWIFT_BENCHMARK_SUBCMAKE_BUILD is set.
This enables us to distinguish in between builds which are triggered by a
subcmake call from the main swift cmake file and one from a user who is trying
to compile the swift benchmark suite against a misc swift installation/use the
ninja file by hand.
2017-10-01 10:41:48 -07:00
Michael Gottesman
a36c649429 [benchmark] We need the module_name in swift_benchmark_compile_archopts to look up sources.
This solves problems relating to the SOURCES variable not finding anything
files. module_name expanded to nothing so:

  ${${module_name}_sources} -> ${_sources} -> ''

Now we handle this properly.

rdar://34556274
2017-09-25 19:27:56 -07:00
Michael Gottesman
5dfbec05c4 [benchmark] Allow for swift3 and swift4 multi source benchmarks
rdar://34556274
2017-09-25 15:26:43 -07:00
Michael Gottesman
1b960d58b7 [benchmark] Extract multisource benchmark cmake code into helper functions.
This is the next step in allowing (at least the multi-source benchmarks) to
compile swift 4 and swift 3 in a nice way.

rdar://34556274
2017-09-25 14:16:39 -07:00
Michael Gottesman
c2d8cc7ff0 [benchmark] Add support for building out of tree via build-script against the just built swift.
I recently broke the out of tree build by mistake [its fixed now ; )]. This
inspired me to make it easy to test this behavior by adding support to
build-script/cmake/etc for running an external benchmark build via
AddExternalProjects.

Now I can just call build-script with --build-external-benchmarks and thats it!
It should just work! It already helped me to avoid breaking the external build
twice!

I hope that eventually we get this on a bot to make sure it keeps working [or
even added to the smoke tests ; )].

*NOTE* This is disabled by default so it will not affect normal builds.

*NOTE* This just builds the external benchmarks. There is an rpath issue that
prevents you from running them (the benchmarks have the rpath set as if they are
next to the stdlib, but they are not. This can be fixed in a few different ways,
but I do not have time to finish implementing it = (. But this commit is a good
first step and at least detects build errors.
2017-09-25 12:31:39 -07:00
Michael Gottesman
574b05d252 Merge pull request #12092 from gottesmm/recommit_benchmark_changes_with_precondition
Recommit benchmark changes with precondition
2017-09-25 10:46:15 -07:00
Michael Gottesman
84f5446a78 Revert "Reverting benchmark cmake changes. They break out-of-tree benchmark builds, which is used by some bots"
This reverts commit db21063afa.
2017-09-24 23:19:25 -07:00
Michael Gottesman
d04f97a3f0 [benchmark][cmake] Provide our own precondition impl.
This ensures that we have a precondition implementation both when building in
tree and out of tree.
2017-09-24 23:19:25 -07:00
Michael Gottesman
83ae78727d [benchmark][cmake] Implement IS_SWIFT_BUILD correctly and rename it to SWIFT_BENCHMARK_BUILT_STANDALONE. 2017-09-24 22:53:50 -07:00
Andrew Trick
cc1165fc43 Benchmark cmake: DriverUtils will depend on TestsUtils. 2017-09-22 12:49:59 -07:00
Andrew Trick
e53451a98b cmake: Benchmarks need to build as a separate project (out-of-tree). 2017-09-22 12:49:59 -07:00
Erik Eckstein
db21063afa Reverting benchmark cmake changes. They break out-of-tree benchmark builds, which is used by some bots
Revert "Refactor out the creation of the benchmark libraries into a helper routine swift_benchmark_library. Initially just use it for DriverUtils."

This reverts commit ac539730e4. (+3 squashed commits)
Squashed commits:
[755f057] Revert "[benchmark][cmake] Refactor the swift benchmark helper libraries to use swift_benchmark_library."

This reverts commit a82945e033.
[58e09c6] Revert "[benchmark][cmake] "swift_benchmark_library" => "add_swift_benchmark_library"."

This reverts commit 0e4b7b69cd.
[5f5f2c1] Revert "[benchmark][cmake] Fix typo. This is NFC since this option is usually disabled."

This reverts commit 30f4b1b3e5.
2017-09-21 17:34:04 -07:00
Michael Gottesman
30f4b1b3e5 [benchmark][cmake] Fix typo. This is NFC since this option is usually disabled. 2017-09-20 17:25:47 -07:00
Michael Gottesman
0e4b7b69cd [benchmark][cmake] "swift_benchmark_library" => "add_swift_benchmark_library".
This matches the names used in the rest of our cmake.

rdar://34556274
2017-09-20 17:25:47 -07:00
Michael Gottesman
a82945e033 [benchmark][cmake] Refactor the swift benchmark helper libraries to use swift_benchmark_library.
rdar://34556274
2017-09-20 17:25:42 -07:00
Michael Gottesman
ac539730e4 Refactor out the creation of the benchmark libraries into a helper routine swift_benchmark_library. Initially just use it for DriverUtils.
This will allow for per-benchmark flags to be added.

rdar://34556274
2017-09-20 16:36:48 -07:00
Dave Abrahams
7f9380d098 Remove bogus options from benchmark build
This option is misleading, and never should have been there in the first place.  Fortunately it was having no effect because the standard library is already compiled to SIL and the internal checks have been eliminated from any benchmark build.
2017-05-30 11:18:41 -07:00
Ted Kremenek
3fb6e71411 Force the benchmark suite to build with -swift-version 3.
Some of the benchmarks use Swift 3 APIs.  Let’s keep them building that
way to not perturb benchmark numbers.

We should consider adding benchmarks that specifically enable -swift-version 4.
2017-04-21 17:25:45 -07:00
Doug Coleman
e7390d1770 Revert "utils: Add swiftenvs, which allow the overriding of compiler tools."
This reverts commit 2b923f3846.
2017-03-22 20:09:34 -07:00
Doug Coleman
9880f65767 Revert "cmake: Ensure that CMAKE_CODESIGN is set instead of trying to run empty"
This reverts commit f3b7485369.
2017-03-22 20:09:34 -07:00
Doug Coleman
f3b7485369 cmake: Ensure that CMAKE_CODESIGN is set instead of trying to run empty
commands.
2017-03-21 21:13:12 -07:00
Doug Coleman
2b923f3846 utils: Add swiftenvs, which allow the overriding of compiler tools. 2017-03-21 14:59:12 -07:00
Erik Eckstein
bafeb39bdb cmake: make benchmarks compilable without -wmo
This only affects benchmark builds for which -whole-module-optimization is removed from BENCHOPTS in benchmark/CMakeLists.txt
2016-10-20 14:27:00 -07:00
Michael Gottesman
6fd9dca2e6 [benchmark] Allow the number of test samples cmake will use to be specified from the command line.
The benchmark bot uses this functionality today to run the benchmarks. By
default build-script only uses 3 samples for each test. Given the noise on our
systems, this is definitely not sufficient for any sort of robust numbers.

Using this patch, I am going to change the benchmarking bot to take the minimum
of 20 samples as we do for our internal benchmarking. This should help make the
benchmark bot give better data. This will have as a cost cause the bot to take
more time. The testing time issue can be solved down the line by changing to a
protocol where we first do tests with a small number of samples (< 5). Then any
benchmark with a delta > 5% is rerun with 20 samples or perhaps until a
statistical criterion is satisfied. But until that is implemented, this at least
makes the bot useful.

There are other things that need to be changed on the benchmarking bot as well,
namely that it should build on a separate machine from which it is running the
benchmarks on. The benchmarking machine should be quiet and not have any work
being done on it. But that is also for another time.
2016-09-23 20:05:10 -07:00
Luke Larson
c60add3668 Stop ad-hoc signing stdlib dylibs for benchmarks
rdar://problem/27619856
2016-08-03 14:11:11 -07:00
Dmitri Gribenko
4329ebefd8 CMake: remove an unused variable 2016-05-30 19:34:29 -07:00
Arnold Schwaighofer
1d2643b93f Support performance testing with automatic bridging disabled. 2016-03-29 15:14:36 -07:00
Arnold Schwaighofer
4492e589e5 [benchmarks] ARC is not the default like I assumed
We are hence leaking ...
2016-03-18 12:01:49 -07:00
Arnold Schwaighofer
50c048d7e9 Add ObjectiveC bridging stub test support
This allows for testing the autogenerated bridging stub code.
2016-03-17 13:42:36 -07:00
Michael Gottesman
8d5a08cedd [perftest][cmake] Standardize on using ${source} instead of ${srcdir}/${module_name_path}.swift.
This is an intermediate commit in a series of commits towards being able to
build the perf test suite from *.sib files.

Doing so will enable us to:

1. Stress the serialization pipeline.
2. Provide an interesting test case for verifying that executables compiled
from *.sib yield the same object files as if we compiled directly to *.o files.

Keep in mind this is a longer term effort that I am doing on the side.
2016-02-26 16:28:28 -08:00
Luke Larson
d4ece4b4d0 [benchmark] Correctly depend on stdlib targets 2016-02-15 17:22:07 -08:00
Luke Larson
2c62011276 [benchmark] Don't hard code directory structure 2016-02-09 15:21:05 -08:00
Michael Gottesman
8093134b8f [perf-test] [cmake] Refactor out arch/optset specific code from swift_benchmark_compile into swift_benchmark_compile_archopts. 2016-02-08 15:07:12 -08:00
Michael Gottesman
c01c70342d [perf-test] [cmake] Rename add-swift-benchmark-suite.cmake => AddSwiftBenchmarkSuite.cmake to match the current naming scheme of cmake modules in swift/llvm. 2016-02-08 14:45:59 -08:00