Commit Graph

612 Commits

Author SHA1 Message Date
Nate Cook
58933d88c5 [stdlib] Rename index(...) methods to firstIndex(...)
A la SE-204.
2018-04-21 18:07:25 -05:00
Erik Eckstein
7aed128e0b benchmarks: make the benchmarks compilable with the swift 4.1 compiler 2018-04-02 17:38:15 -07:00
Slava Pestov
e1f50b2d36 SE-0193: Rename @_inlineable to @inlinable, @_versioned to @usableFromInline 2018-03-30 21:55:30 -07:00
Michael Gottesman
d7fc0e1170 [benchmark] Enable users of Benchmark_QuickCheck to select a specific opt level to run from the command line. 2018-03-25 10:46:13 -07:00
Max Moiseev
9ee2fe9b10 Merge pull request #15376 from moiseev/filter-map-filter-map
[benchmark] Add a benchmark for .lazy.filter.map chaining...
2018-03-20 14:53:22 -07:00
Max Moiseev
c4e2b548dc [benchmark] Add a benchmark for .lazy.filter,map chaining...
... and functionally equivalent single call to .lazy.compactMap.

See https://forums.swift.org/t/introduce-lazy-version-of-compactmap/9835
for more info.
2018-03-20 11:54:18 -07:00
Karoy Lorentey
a7d529c230 Merge pull request #15339 from lorentey/deterministic-benchmarks
[benchmark] Driver: stabilize Dictionary/Set benchmarks
2018-03-19 22:11:19 +00:00
Karoy Lorentey
77fa298276 [benchmark] WordCount: Use a unified buildWorkload() func
setUpFunction code should be located together with the corresponding runFunction code, so that we can verify them at a glance. However, we can't really do that yet, and doing the setUp for all tests in bulk makes it less likely that we make a mistake in matching up tests with their corresponding setups. :/
2018-03-19 18:46:29 +00:00
Karoy Lorentey
11515c1676 [benchmark] Driver: stabilize Dictionary/Set benchmarks
Disable the random hash seed while benchmarking. By its nature, it makes the number of hash collisions fluctuate between runs, adding unnecessary noise to benchmark results.

I expect we'll be able to re-enable random seeding here once we have made hash collisions cheaper -- they are currently always resolved by calling the Key's Equatable implementation, which can be expensive.
2018-03-19 17:38:29 +00:00
Karoy Lorentey
ea99af40b3 [benchmark] WordCount: Also blackHole WordSplit tests, for good measure 2018-03-19 15:06:23 +00:00
Karoy Lorentey
872efe151b [benchmark] WordCount: Initialize global variables in setUpFunction.
WordCount shows significant variance between iterations, which is apparently caused by the initialization of someAlphanumerics and asciiWords/utf16Words leaking into the measured part of the benchmark.

Making sure these variables are initialized before we start measuring elapsed time stabilizes the results.
2018-03-19 14:51:29 +00:00
Michael Gottesman
30dd85d386 [benchmark] Add a new utility script called Benchmark_QuickCheck.
This benchmark script is similar to the guard malloc/runtime runner, but it only
runs the tests. The intention is that one can use this to quickly in a
multithreaded way verify that all benchmarks run successfully. In contrast, the
normal driver will run only single threaded since it is meant to test
performance, so is not able to take advantage of all cores on a system.

I wrote this quickly to verify some benchmark tests still worked. No point in
not sharing with everyone else.
2018-03-17 11:39:52 -07:00
Karoy Lorentey
06c33c0ca8 [benchmark] FloatingPointPrinting: Fix benchmark failures 2018-03-16 18:12:40 +00:00
Karoy Lorentey
93c0411d34 Merge pull request #15073 from lorentey/dictionary-swapat
[benchmark] Add benchmarks for Dictionary.swapAt(_:,_:)
2018-03-15 21:02:24 +00:00
Andrew Trick
b2d96ddab5 Bypass Float80 benchmarks on Windows. 2018-03-15 13:34:40 -07:00
tbkka
848de7e84c Benchmark {Float,Double,Float80}.description (#15234)
* Benchmark {Float,Double,Float80}.description

This just tests how fast we can format the standard
floating-point types.  It also includes a test that
uses the result, to ensure that future optimized
_creation_ of the string doesn't incidentally pessimize
_use_ of the results.

* Benchmark {Float,Double,Float80}.description

This just tests how fast we can format the standard
floating-point types.  It also includes a test that
uses the result, to ensure that future optimized
_creation_ of the string doesn't incidentally pessimize
_use_ of the results.

* Add benchmarks for values close to 1 + other review suggestions
2018-03-15 14:09:35 -04:00
Tony Parker
130ce14f16 Merge pull request #15221 from parkera/parkera/data_benchmarks
Updated Data benchmarks
2018-03-15 09:01:18 -07:00
Tony Parker
bfa0be99e7 Use blackHole to ensure inner loops are not optimized away; switch subscript benchmark to 10000*N style 2018-03-14 12:39:12 -07:00
Tony Parker
19c6ccf5af Updated Data benchmarks 2018-03-13 17:29:50 -07:00
Karoy Lorentey
e642a3fe08 [benchmark] Fix issues uncovered in review 2018-03-13 20:38:46 +00:00
Karoy Lorentey
c2eccf2b4d [benchmark] Add benchmarks for Dictionary operations with quadratic behavior
Dictionary and Set currently exhibit O(n^2) behavior for certain operations involving copying elements in bulk. Add benchmarks to verify an upcoming fix and to catch regressions later.

https://bugs.swift.org/browse/SR-3268
2018-03-13 19:42:45 +00:00
Andrew Trick
55021a8a0f Add a benchmark cmake flag SWIFT_RUNTIME_ENABLE_LEAK_CHECKER.
This is necessary to build standalone benchmarks with leak checking
enabled. This is useful if you want to debug an internal benchmark failure using
a public swift.
2018-03-08 20:13:58 -08:00
Karoy Lorentey
80b36d271b [benchmark] Add benchmarks for Dictionary.Values.swapAt(_:,_:) 2018-03-08 12:44:11 +00:00
Michael Ilseman
7f1ba5d22d Merge pull request #14992 from milseman/bench_builder
[benchmark] More StringBuilder/Interpolation benchmarks
2018-03-06 15:09:01 -08:00
swift-ci
8ace7b8f7f Merge pull request #14988 from xwu/benchmark-fp-properties 2018-03-05 18:18:22 -08:00
Xiaodi Wu
7cb94890b4 Add binary floating-point properties benchmarks 2018-03-05 19:26:03 -06:00
Michael Ilseman
87b24738d8 [benchmark] Add string interpolation benchmarks
Add some benchmarks for when the whole interpolated string is small,
and when it is very large but every segment is pretty small.
2018-03-05 14:25:41 -08:00
Michael Ilseman
0a301aa2ba [benchmark] More StringBuilder and improvements 2018-03-05 14:25:41 -08: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
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
Huon Wilson
2130ba9808 Revert "[benchmark] Add interpolation; more stable builder" 2018-03-01 19:05:10 -08:00
Michael Ilseman
959f45edc0 [benchmark] Add string interpolation benchmarks
Add some benchmarks for when the whole interpolated string is small,
and when it is very large but every segment is pretty small.
2018-02-28 19:15:42 -08:00
Michael Ilseman
46ab97a0d5 [benchmark] Attempt to make StringBuilder more stable.
Use getString and blackHole more.
2018-02-28 17:45:23 -08:00
swift-ci
3956205f76 Merge pull request #14662 from airspeedswift/remove-where-benchmark 2018-02-15 17:17:56 -08:00
Ben Cohen
220883f20c Sequence algorithm benchmarks (#14663) 2018-02-15 16:07:00 -08:00
Ben Cohen
1e820dc505 Add benchmarks based on different remove(where:) implementations 2018-02-15 16:03:38 -08:00
Ben Cohen
3b4eacc3a8 Update benchmarks to Swift 4 (#14623) 2018-02-14 17:26:58 -08:00
swift-ci
fbaaa75537 Merge pull request #14483 from lorentey/largekey-benchmark 2018-02-08 08:35:08 -08:00
Karoy Lorentey
ba978d3338 [benchmark] Add benchmark exercising the hash compression function 2018-02-08 15:19:22 +00:00
Andrew Trick
0723aacb5b Disable DoubleWidthDivision.swift benchmark.
This takes more than 15 minutes to compile and makes the benchmark suite
unusable. There are multiple severe compile issues that need to be fixed
properly before we can support the DoubleWidth API.

See [SR-6947] DoubleWidth compile time.
2018-02-07 14:11:35 -08:00
Ben Cohen
cfd322593c Add Queue benchmark that tests popLast generically and concretely (#14393) 2018-02-03 11:53:05 -08:00
Ben Cohen
ab8e3a7ebc Fix warnings in various benchmarks (#14333) 2018-02-01 19:48:35 -08:00
Michael Ilseman
86e353a682 Revert "Try disabling CSV benchmarks to see if that unsticks PR benchmark runs" 2018-01-29 11:49:00 -08:00
Max Moiseev
9a7b4cc578 Merge pull request #14220 from airspeedswift/skip-csv-benchmarks
Try disabling CSV benchmarks to see if that unsticks PR benchmark runs
2018-01-29 11:13:03 -08:00
Michael Gottesman
70251a3ff8 Add a 10 minute timeout to individual tests.
On the bots, we have a timeout without output of 60 minutes for the entire test.
This should ensure that we are able to kill mis-behaving tests and give a good
error instead of just getting a jenkins timeout error.

For those confused, this is for the guard malloc/leaks test.

rdar://36874229
2018-01-29 09:33:11 -08:00
ben-cohen
3c87fe0b20 Try disabling CSV benchmarks to see if that unsticks PR benchmark runs 2018-01-28 08:39:49 +00:00
swift-ci
229087f89e Merge pull request #14179 from atrick/fix 2018-01-25 22:05:40 -08:00
Andrew Trick
b254b6c069 Update benchmark README.md 2018-01-25 20:35:59 -08:00
Xiaodi Wu
63de0c56b7 Increase DoubleWidth division benchmark iterations 2018-01-24 16:01:50 -06:00