Commit Graph

154 Commits

Author SHA1 Message Date
Pavol Vaskovic
c7fc745fff [benchmark] Removed bogus Totals stats
Report only the total number of executed tests.

Aggregating MIN, MAX and MEAN values for all executed benchmarks together (with microsecond precision!) has no statistical relevance.
2018-07-17 07:28:39 +02:00
Pavol Vaskovic
0efdd8d67f [benchmark][Gardening] Nicer header composition 2018-07-17 07:28:39 +02:00
Pavol Vaskovic
7f894268b2 [benchmark] Restore running benchmarks by numbers
Reintroduced feature lost during `BenchmarkInfo` modernization: All registered benchmarks are ordered alphabetically and assigned an index. This number can be used as a shortcut to invoke the test instead of its full name. (Adding and removing tests from the suite will naturally reassign the indices, but they are stable for a given build.)

The `--list` parameter now prints the test *number*, *name* and *tags* separated by delimiter.

The `--list` output format is modified from:
````
Enabled Tests,Tags
AngryPhonebook,[String, api, validation]
...
````
to this:
````
\#,Test,[Tags]
2,AngryPhonebook,[String, api, validation]
…
````
(There isn’t a backslash before the #, git was eating the whole line without it.)
Note: Test number 1 is Ackermann, which is marked as “skip”, so it’s not listed with the default `skip-tags` value.

Fixes the issue where running tests via `Benchmark_Driver` always reported each test as number 1. Each test is run independently, therefore every invocation was “first”. Restoring test numbers resolves this issue back to original state: The number reported in the first column when executing the tests is its ordinal number in the Swift Benchmark Suite.
2018-07-11 23:17:02 +02:00
Pavol Vaskovic
2d004970fd [benchmark] Fix: Running skip-tag-marked benchmark
Also updated benchmark documentation with more detailed description of tag handling.
2018-07-11 23:17:02 +02:00
Pavol Vaskovic
d40ddabcd5 [benchmark] Fix: running with --num-iters=1
Fixed bug where the `elapsed_time` was always 0 when `--num-iters=1` was specified.
2018-07-11 23:17:02 +02:00
Pavol Vaskovic
8b03980cb0 [benchmark] DRY: Call setup and teardown only once 2018-07-11 23:17:02 +02:00
Pavol Vaskovic
4c4c6a2409 [benchmark] Fix: Better tags in benchmark list
When listing benchmarks with `--list` parameter, present the tags in format that is actually accepted by the `--tags` and `--skip-tags` parameters.

Changes the `--list` output from
````
Enabled Tests,Tags
AngryPhonebook,[TestsUtils.BenchmarkCategory.validation, TestsUtils.BenchmarkCategory.api, TestsUtils.BenchmarkCategory.String]
...
````
into
````
Enabled Tests,Tags
AngryPhonebook,[String, api, validation]
…
````
2018-07-11 23:17:02 +02:00
Karoy Lorentey
f7c4832bfe [benchmark] Fix integer overflow issues on 32-bit platforms
The automatic scaling mechanism may end up with iteration counts greater than 2^31, leading to integer overflow.
2018-06-15 16:56:26 -07:00
Erik Eckstein
c70970c60f benchmarks: fix the handling of the --help command line option
It displayed the help if the option was _not_ specified.
2018-05-29 12:47:08 -07:00
Michael Gottesman
cee593c267 [benchmark] Add a small --help menu to the low level driver that just dumps the current valid options list.
We probably should have added this sooner...
2018-05-29 00:03:46 -07:00
Michael Gottesman
45b7743086 [benchmark] Add the ability for a benchmark to specify that it does not run on specific platforms.
Today, one can not completely disable a benchmark depending on the platform
without changing the source of main.swift. We would like to be able to disable
benchmarks locally in a benchmark's file without needing to modify the rest of
the infrastructure. The closest that one can get to such behavior is to just
conditionally compile out the file locally. But one still will have the test
run.

This commit adds support for not-running the benchmark on specific
platforms. This in combination with conditional compilation of benchmark bodies,
allows us to not have to comment out module's in main.swift or have to
conditionally compile testinfo.

rdar://40541972
2018-05-28 18:12:58 -07:00
Kamil Pyć
782ee2010a Further optimisation with guard 2018-03-03 19:57:27 +01:00
Kamil Pyć
8b997b4965 Removed redundant check
Since init for Int with empty string returns nil there is no need for additional checking for empty string
2018-03-03 05:54:10 +01:00
Michael Ilseman
3be2faf5d3 [String] Initial implementation of 64-bit StringGuts.
Include the initial implementation of _StringGuts, a 2-word
replacement for _LegacyStringCore. 64-bit Darwin supported, 32-bit and
Linux support in subsequent commits.
2018-01-21 12:32:26 -08:00
Erik Eckstein
383920fc24 benchmarks: remove legacy benchmark lists in Driver
They are not used anymore.
2017-12-04 15:41:21 -08:00
Greg Parker
58c9b45c78 [runtime] Clean up symbols in StdlibUnittest and the internal leak checker.
* Export fewer symbols.
* Prefix exported but not-public symbols with `_swift_`.
2017-10-24 13:13:43 -07:00
Max Moiseev
86eeb5416b Introduce .skip tag and properly handle --skip-tags parameter 2017-10-03 10:07:50 -07:00
Max Moiseev
528b3a0f3a [benchmark] Remove precommit/registered flags, add skipTags
The idea being, we need to decide what benchmarks to run solely based on
tags.

`--tag` allows to list all tags that are required;
`--skip-tags` allows to skip benchmarks that have any of those tags.

By default, skip-tags list contains .unstable and .String, which results
in the same subset of benchmarks as before.
2017-10-03 09:37:56 -07:00
Max Moiseev
cc723b9aff Minor refactoring 2017-10-02 17:10:44 -07:00
swift-ci
a0a1a76cfe Merge pull request #12146 from gottesmm/add_support_for_initFunction 2017-09-28 11:05:52 -07:00
Michael Gottesman
2a6b4fbb38 [benchmark] Re-add support for anding multiple tags by splitting on ','
As an example:

--tags=Array,cpubench

would select all tests that are both tagged as Array benchmarks and cpu
benchmarks.
2017-09-28 10:11:23 -07:00
Michael Gottesman
f7681a993a [benchmark] Add support for specifying a benchmark setUp and tearDown function via BenchmarkInfo.
The key thing here is that by providing one of these closures, a benchmark can
inject the initialization/deinitialization of its internal data structures,
outside of the time period where timing is occurring.

The intention is that this will provide us the framework for as we annotate
tests with BenchmarkInfo, to move initialization work out of benchmarks.

It will also allow for more complex benchmarks to be written such as ones that
perform bulk reads from a pipe (my interest in this).
2017-09-28 09:57:46 -07:00
Michael Gottesman
5cdd946734 [benchmark] Simplify how we filter tests down to 1 filter implementation.
Previously, we both filtered tests and marked tests as not being able to be run.
This commit rips out the marking of tests as being unable to be run (but counted
as part of the indices output by the compiler).

This also ensures benchmarks that are run are always given an ascending index
instead of sometimes having indices being skipped.
2017-09-28 09:43:20 -07:00
Michael Gottesman
37c8052494 [benchmark] Change DriverUtils.Test to contain a BenchmarkInfo struct instead of destructuring a BenchmarkInfo.
This will allow me to add support for running an initFunction before running
samples.
2017-09-27 12:46:38 -07:00
Michael Gottesman
8a69de7332 [benchmark] Have legacy tests use BenchmarkInfo and combine this with registered benches.
*NOTE* We always prefer a registered benchmark if we have one.

I am going to use BenchmarkInfo to solve the "create data for benchmark while we
are already timing" problem. I am going to add a field to BenchmarkInfo that if
it is not-null is called before we start measuring time. This closure can be
used to initialize any global data structures/etc.

But to do this, I need to be able to combine the registered and legacy
not-registered benchmarks.
2017-09-27 12:46:38 -07:00
Michael Gottesman
f1e6e86a9e [benchmark] Eliminate a multiple ternary operator in favor of a closure.
These are really hard to read naively.
2017-09-27 10:02:07 -07:00
Michael Gottesman
77acbe82b7 [benchmark] Rename BenchmarkCategories => BenchmarkCategory.
This is an enum that represents a single category of benchmarks. Per the API
guidelines this should really be singular.
2017-09-26 19:28:34 -07:00
Michael Gottesman
45b1609c23 [benchmark] Make BenchmarkCategories a StringEnum.
This ensures that we get BenchmarkCategories <-> String for free and enables the
code that implemented that transform to be deleted.
2017-09-26 19:28:05 -07:00
Michael Gottesman
d7f4c99696 [benchmark] Update DriverUtils to match the API guidelines closer. 2017-09-26 19:04:22 -07:00
Joe Shajrawi
ca6ccb4864 Benchmark categorization support 2017-09-22 17:39:04 -07:00
Andrew Trick
78b072b4da Add a CPU microbenchmarks for isUniquelyReferenced. 2017-09-22 16:38:49 -07:00
Andrew Trick
d9af4c5f45 Introduce BenchmarkInfo and BenchmarkCategories. 2017-09-22 12:49:59 -07:00
Pavol Vaskovic
f244b54e68 Fix SR-4780
SR-4780 Can not run performance tests that are not in precommit suite

Modified driver to honor command line arguments when listing enabled tests. Fixed interaction between filters (positional arguments) and --run-all option.

Benchmark_Driver lists available benchmarks with --run-all option when benchmarks or filters are specified.
2017-06-07 21:13:50 +02:00
Michael Ilseman
9ffc2f073a [benchmark] Add String test suite (off by default)
Starts a String perf test suite called stringTests which is
off-by-default, but allows us to place some lower-level targeted
benchmarking.
2017-04-19 13:31:34 -07:00
Mikio Takeuchi
593155f78b Make benchmarks compile and run on Linux 2017-03-06 17:13:47 +09:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
practicalswift
fa7fbdb8b0 [gardening] Remove redundant nil-initialization of optional variable
From the Swift documentation:

"If you define an optional variable without providing a default value,
 the variable is automatically set to nil for you."
2016-09-18 07:40:07 +02:00
Michael Ilseman
25ac879aea [noescape by default] Fix benchmarks and incorporate feedback
Adds @escaping to internal benchmark code to fix it. References SR for
known limitation. Use stdlib coding style for arguments.
2016-07-29 13:49:08 -07:00
Andrew Trick
a18d490d6a Migrate from UnsafePointer<Void> to UnsafeRawPointer. (#3773)
* Migrate from `UnsafePointer<Void>` to `UnsafeRawPointer`.

As proposed in SE-0107: UnsafeRawPointer.

`void*` imports as `UnsafeMutableRawPointer`.
`const void*` imports as `UnsafeRawPointer`.

Occurrences of `UnsafePointer<Void>` are replaced with UnsafeRawPointer.

* Migrate overlays from UnsafePointer<Void> to UnsafeRawPointer.

This requires explicit memory binding in several places,
particularly in NSData and CoreAudio.

* Fix a bunch of test cases for Void->Raw migration.

* qsort takes IUO values

* Bridge `Unsafe[Mutable]RawPointer as `void [const] *`.

* Parse #dsohandle as UnsafeMutableRawPointer

* Update a bunch of test cases for Void->Raw migration.

* Trivial fix for the SceneKit test case.

* Add an UnsafeRawPointer self initializer.

This is unfortunately necessary for assignment between types imported from C.

* Tiny simplification of the initializer.
2016-07-26 14:21:15 -07:00
Andrew Trick
0ed9ee8dee Revert "Migrate from UnsafePointer<Void> to UnsafeRawPointer. (#3724)"
This reverts commit ece0951924.

This results in lldb failues on linux that I can't readily debug.
Backing out until they can be resolved.
2016-07-26 02:50:57 -07:00
Andrew Trick
ece0951924 Migrate from UnsafePointer<Void> to UnsafeRawPointer. (#3724)
* Migrate from `UnsafePointer<Void>` to `UnsafeRawPointer`.

As proposed in SE-0107: UnsafeRawPointer.

`void*` imports as `UnsafeMutableRawPointer`.
`const void*` imports as `UnsafeRawPointer`.

Occurrences of `UnsafePointer<Void>` are replaced with UnsafeRawPointer.

* Migrate overlays from UnsafePointer<Void> to UnsafeRawPointer.

This requires explicit memory binding in several places,
particularly in NSData and CoreAudio.

* Fix a bunch of test cases for Void->Raw migration.

* qsort takes IUO values

* Bridge `Unsafe[Mutable]RawPointer as `void [const] *`.

* Parse #dsohandle as UnsafeMutableRawPointer

* Update a bunch of test cases for Void->Raw migration.

* Trivial fix for the SceneKit test case.

* Add an UnsafeRawPointer self initializer.

This is unfortunately necessary for assignment between types imported from C.

* Tiny simplification of the initializer.
2016-07-26 02:18:21 -07:00
practicalswift
808b539f10 [gardening] Minor syntax cleanups. 2016-07-09 13:27:57 +02:00
practicalswift
dc6c2aeef6 [gardening] "Type->Type" → "Type -> Type" in Swift code 2016-04-13 23:03:55 +02:00
Dave Abrahams
1c3d998951 Revert "[gardening] "Type->Type" → "Type -> Type" in Swift code"
This reverts commit 14edeaf67a because
it's breaking tests:
https://ci.swift.org/job/oss-swift-incremental-RA-osx/lastFailedBuild/consoleFull#1361088108ee1a197b-acac-4b17-83cf-a53b95139a76
2016-04-13 10:29:57 -07:00
practicalswift
14edeaf67a [gardening] "Type->Type" → "Type -> Type" in Swift code 2016-04-13 10:51:53 +02:00
Manav Gabhawala
7928140f79 [SE-0046] Implements consistent function parameter labels by discarding extraneous parameter names and adding _ where necessary 2016-04-06 20:21:58 -04:00
Max Moiseev
7fe6916bf6 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-03-07 12:10:47 -08:00
Michael Gottesman
47888558be [perftests] Fix thinko due to my brains failure to remember to push a new version of this commit. 2016-03-03 15:51:03 -08:00
Michael Gottesman
afece1c8c2 [perftests] Add some sanity asserts to the low level perf test suite driver results.
This just consists of ensuring that:

1. min <= max.
2. min <= mean.
3. min <= median.
4. max >= mean.
5. max >= median.
2016-03-03 13:11:33 -08:00