Commit Graph

224 Commits

Author SHA1 Message Date
Karoy Lorentey
ba978d3338 [benchmark] Add benchmark exercising the hash compression function 2018-02-08 15:19:22 +00:00
Ben Cohen
cfd322593c Add Queue benchmark that tests popLast generically and concretely (#14393) 2018-02-03 11:53:05 -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
ben-cohen
3c87fe0b20 Try disabling CSV benchmarks to see if that unsticks PR benchmark runs 2018-01-28 08:39:49 +00:00
Max Moiseev
ea38221ce6 Merge pull request #14043 from xwu/benchmark-doublewidth-division
[benchmark] Add DoubleWidth division benchmark
2018-01-22 12:54:29 -08:00
Michael Ilseman
7e58fd2cb5 [benchmark] Add two new CSVParsing alternative benchmarks.
The first is copied from https://github.com/apple/swift/pull/13930's
contribution (with a minor bug fix applied). The second is an
adaptation that tries to avoid creating copies and operate using
indices directly.
2018-01-21 18:07:07 -08:00
Xiaodi Wu
bc0e80634e [benchmark] Add DoubleWidth division benchmark 2018-01-20 23:59:17 -06:00
Xiaodi Wu
3887c59bb8 Add binary floating-point conversion benchmark 2018-01-15 16:11:19 -06:00
Michael Ilseman
d9fa4f5d0d [benchmark] More CharacterProperty variations 2018-01-08 13:05:23 -08:00
Karoy Lorentey
548878f733 Merge pull request #13731 from lorentey/romannumbers
[benchmark] Add roman numeral conversion benchmark
2018-01-08 19:27:11 +00:00
Karoy Lorentey
3312a22c1a Merge pull request #13725 from lorentey/wordcount
[benchmark] Add word counting benchmarks
2018-01-08 14:46:15 +00:00
Karoy Lorentey
6098fa4ac4 [benchmark] Add word counting benchmarks 2018-01-08 12:00:21 +00:00
Max Moiseev
861df1cdf9 Merge pull request #13770 from moiseev/pointer-arith-bench
[benchmark] Add a microbenchmark for the UnsafePointer.+
2018-01-06 16:42:03 -08:00
Michael Gottesman
24027067b9 [benchmarks] Add some more benchmarks by our very own airspeedswift.
With his permission of course.
2018-01-06 01:15:37 -05:00
Michael Ilseman
5eb699978a Merge pull request #13759 from milseman/csv_benchmarks
[benchmark] Hook up CSVParsing to suite
2018-01-05 21:22:05 -08:00
Max Moiseev
11f8f4c485 [benchmark] Add a microbenchmark for the UnsafePointer.+
UnsafePointer implementation contains the following note:

> Note: The following family of operator overloads are redundant with
Strideable. However, optimizer improvements are needed before they can
be removed without affecting performance.

... but it looks like there is no benchmark to support this claim.
2018-01-05 18:00:18 -08:00
Michael Ilseman
1eaf1f5571 [benchmark] Hook up CSVParsing to suite 2018-01-05 13:43:46 -08:00
Michael Ilseman
1c2954b133 [benchmark] Add a CharacterProperties benchmark 2018-01-05 11:27:36 -08:00
Karoy Lorentey
9e375bbce2 [benchmark] Add roman numeral conversion benchmark 2018-01-04 18:31:49 +00:00
Karoy Lorentey
9fef06e59c Merge pull request #12752 from hamishknight/dictionary-subscript-addressor
[stdlib] Use addressor for Dictionary's subscript(_:default:)
2017-12-04 15:04:29 +01:00
Lance Parker
4cad7535b7 Added comparison benchmarks
# Conflicts:
#	benchmark/single-source/StringComparison.swift
2017-12-01 16:54:08 -08:00
Hamish
f7015c2984 [stdlib] Added benchmarks for Dictionary's subscript(_:default:) 2017-11-19 15:45:27 +00:00
Max Moiseev
95cd5221f9 Remove a misleading comment 2017-10-04 14:54:04 -07:00
Max Moiseev
26c498c005 [benchmark] Add RangeIteration benchmarks 2017-10-04 14:50:29 -07:00
Max Moiseev
1dd9d61ded Move all benchmarks to use registerBenchmark and BenchmarkInfo 2017-10-03 18:04:56 -07:00
Max Moiseev
68cdba2df2 Use registerBenchmark for all benchmarks 2017-10-03 10:07:14 -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
swift-ci
a0a1a76cfe Merge pull request #12146 from gottesmm/add_support_for_initFunction 2017-09-28 11:05:52 -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
Andrew Trick
a4f4b72e4e Stip .abstraction tag from most benchmarks.
Only use the .abstraction tag for benchmarks that are primarilly stressing the
optimization of a specific kind of abstraction. Then I can use these as CPU
benchmarks.

Previously this tag was applied to any benchmark that happened to involve
classes or protocols. When a compiler engineer changes something that might
affect codegen in these cases, they should simply benchmark the entire stable
suite. There's no value in having a separate set of 97 "abstraction" benchmarks
that are primarilly testing something else, like a stdlib API.
2017-09-27 11:06:10 -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
7a188c6039 [benchmark] Add PrimsSplit a multi source version of the Prims benchmark.
This will enable us to at least validate on swift.org that the multisource
benchmark stuff is working.

rdar://34556274
2017-09-25 19:27:56 -07:00
Andrew Trick
3560ad2203 Register AnyHashableWithAClass benchmark. 2017-09-22 21:25:46 -07:00
Andrew Trick
e7edd270e5 Register PolymorphicCalls benchmark. 2017-09-22 21:11:30 -07:00
Andrew Trick
a6dcdfda29 Register SevenBoom benchmark. 2017-09-22 21:06:51 -07:00
Andrew Trick
d38e8da6a2 Register the LinkedList benchmark. 2017-09-22 20:51:46 -07:00
Andrew Trick
c0ffc0d451 Register the Exclusivity benchmark. 2017-09-22 20:43:23 -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
Erik Eckstein
d6f6774214 benchmarks: add a benchmark for string enum construction from a string raw value. 2017-09-18 17:50:24 -07:00
Dave Abrahams
31341e6753 Merge pull request #10976 from d-ronnqvist/reduce-with-inout
[stdlib] Implement SE-0171: Reduce with inout
2017-07-23 19:57:25 -07:00
David Rönnqvist
bc235afcf8 [stdlib] Update reduce benchmark to compare the two forms
The ReduceInto benchmark performs three tasks using both `reduce(_:_)` and `reduce(into:_:)` so that their performance can be compared:

1. Summing an array, reducing to `Int`
2. Filtering an array, reducing to `[Int]`
3. Counting letter frequencies, reducing to `[Character: Int]`
2017-07-18 17:42:27 +02:00
Erik Eckstein
ffa38bbf84 Revert "Add benchmarks for a number of NSStringAPI functions"
This reverts commit cf73e560ad.

The benchmarks are causing leaks.
Reverted until this is investigated.
2017-07-17 17:38:49 -07:00
David Rönnqvist
e15ea5fcf3 [stdlib] Implement reduce with inout (SE-0171)
Implement and document `reduce(into:_:)`, with a few notes:

 - The `initial` parameter was renamed `initialResult` to match the first parameter in `reduce(_:_:)`.
 - The unnamed `combining` parameter was renamed `updateAccumulatingResult` to try and resemble the naming of the closure parameter in `reduce(_:_:)`.
 - The closure throws and `reduce(into:_)` re-throws.
 - This documentation mentions that `reduce(into:_)` is preferred over `reduce(_:_:)` when the result is a copy-on-write type and an example where the result is a dictionary.

Add benchmarks for reduce with accumulation into a scalar, an array, and a dictionary.

Update expected error message in closures test (since there are now two `reduce` methods, the diagnostic is different).
2017-07-14 23:24:42 +02:00
Philippe Hausler
cf73e560ad Add benchmarks for a number of NSStringAPI functions 2017-07-13 11:33:35 -07:00
Andrew Trick
b76794ce2b Benchmarks for memory exclusivity enforcement.
Three blind microbenchmarks:
- global access
- materializeForSet class property
- nested independent access
2017-06-29 14:31:46 -07:00
Michael Ilseman
bd5189c25a [String] Grapheme fast paths for punctuation: 5-8x speedup.
Many strings use non-sub-300 punctuation characters (e.g. unicode
hyphen, CJK quotes, etc). This can cause switching between fast and
slow paths for grapheme breaking. Add in fast-paths for general
punctuation characters and CJK punctuation and symbol characters.

This results in about a 5-8x speedup for heavily (unicode) punctuated
Latiny and CJKy workloads.
2017-06-27 19:18:51 -07:00
Dave Abrahams
cb4c656bc2 [stdlib] Add benchmarks for Character's unicodeScalars view
In local testing, these benchmark results change as follows due to f212fac717:

<details open>
  <summary>Regression (20)</summary>

TEST                                              | OLD    | NEW    | DELTA   | SPEEDUP
---                                               | ---    | ---    | ---     | ---
CharIteration_utf16_unicodeScalars                | 33074  | 79510  | +140.4% | **0.42x**
CharIteration_utf16_unicodeScalars_Backwards      | 73826  | 115515 | +56.5%  | **0.64x**

</details>

<details open>
  <summary>Improvement (43)</summary>

TEST                                              | OLD    | NEW    | DELTA   | SPEEDUP
---                                               | ---    | ---    | ---     | ---
CharIndexing_korean_unicodeScalars                | 118425 | 10360  | -91.3%  | **11.43x**
CharIndexing_tweet_unicodeScalars_Backwards       | 226366 | 19850  | -91.2%  | **11.40x**
CharIndexing_tweet_unicodeScalars                 | 240596 | 21178  | -91.2%  | **11.36x**
CharIndexing_japanese_unicodeScalars_Backwards    | 136265 | 12032  | -91.2%  | **11.33x**
CharIndexing_chinese_unicodeScalars               | 92226  | 8146   | -91.2%  | **11.32x**
CharIndexing_russian_unicodeScalars               | 100908 | 8948   | -91.1%  | **11.28x**
CharIndexing_japanese_unicodeScalars              | 145414 | 12895  | -91.1%  | **11.28x**
CharIndexing_ascii_unicodeScalars                 | 121438 | 10779  | -91.1%  | **11.27x**
CharIndexing_russian_unicodeScalars_Backwards     | 94190  | 8367   | -91.1%  | **11.26x**
CharIndexing_korean_unicodeScalars_Backwards      | 110175 | 9803   | -91.1%  | **11.24x**
CharIndexing_chinese_unicodeScalars_Backwards     | 86479  | 7715   | -91.1%  | **11.21x**
CharIndexing_ascii_unicodeScalars_Backwards       | 113255 | 10132  | -91.1%  | **11.18x**
CharIteration_ascii_unicodeScalars_Backwards      | 114873 | 13701  | -88.1%  | **8.38x**
CharIteration_chinese_unicodeScalars_Backwards    | 85778  | 10411  | -87.9%  | **8.24x**
CharIteration_russian_unicodeScalars_Backwards    | 94504  | 11471  | -87.9%  | **8.24x**
CharIteration_japanese_unicodeScalars_Backwards   | 136231 | 16569  | -87.8%  | **8.22x**
CharIteration_tweet_unicodeScalars_Backwards      | 222907 | 27165  | -87.8%  | **8.21x**
CharIteration_korean_unicodeScalars_Backwards     | 110132 | 13443  | -87.8%  | **8.19x**
CharIteration_korean_unicodeScalars               | 79540  | 11859  | -85.1%  | **6.71x**
CharIteration_russian_unicodeScalars              | 68209  | 10211  | -85.0%  | **6.68x**
CharIteration_japanese_unicodeScalars             | 98016  | 14690  | -85.0%  | **6.67x**
CharIteration_tweet_unicodeScalars                | 161177 | 24227  | -85.0%  | **6.65x**
CharIteration_chinese_unicodeScalars              | 61702  | 9278   | -85.0%  | **6.65x**
CharIteration_ascii_unicodeScalars                | 81049  | 12218  | -84.9%  | **6.63x**

</details>
2017-06-27 17:25:41 -07:00
Erik Eckstein
f45bddcaa6 benchmarks: Convert the GlobalClass benchmark to a SILOptimizer test
The purpose of the benchmark was to check a very specific ARC optimization, which is better tested with a lit test.
Beside that, the benchmark was broken anyway.
2017-06-21 14:32:29 -07:00