Commit Graph

10 Commits

Author SHA1 Message Date
Karoy Lorentey
8944591e71 [benchmark] Simplify benchmark registration 2021-09-15 22:08:08 -07:00
Karoy Lorentey
8910b75cfe [benchmark] Stop capitalizing function and variable names 2021-09-15 22:08:07 -07:00
Karoy Lorentey
203dc55b60 [benchmark] CheckResults → check
Capitalizing function names is against Swift naming conventions.
2021-09-15 22:08:07 -07:00
Pavol Vaskovic
c7524d3d9a Merge pull request #24677 from palimondo/janitor’s-last-stand
[benchmark] Janitor Duty: Final Sweep
2020-04-15 19:44:02 +02:00
Pavol Vaskovic
7c951410f4 [Gardening] Remove extra Foundation imports
Remove the import of Foundation where it is not necessary for testing the ObjC interop.
2019-06-28 16:42:27 +02:00
Pavol Vaskovic
d76228b488 [benchmark] FrequenciesUsingReduce Legacy Factor 2019-05-19 19:41:59 +02:00
Pavol Vaskovic
8d00ce0efb [benchmark] FilterEvenUsingReduce Legacy Factor 2019-01-22 09:26:05 +01:00
Max Moiseev
1dd9d61ded Move all benchmarks to use registerBenchmark and BenchmarkInfo 2017-10-03 18:04:56 -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
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