Skip to content

Commit bc47e8a

Browse files
committed
[benchmark] Flatten - Extended test family
The extended `Flatten` test family is based on recently added benchmarks `FlattenLostLoop` and `FlattenListFlatMap`. They had unnecessarily large base workloads, which prevented more precise measurement. Their base workload was lowered by a factor of 20. See discussion on swiftlang#20116 (comment) Since these are recent additions to the Swift Benchmark Suite, I’m removing the originals and reintroducing them under new names `Flatten.Array.Tuple4.flatMap` and `Flatten.Array.Tuple4.for-in.Reserve`without going through the `legacyFactor`. Based on these two templates, this commit introduces thorough performance test coverage of the related space including: * method chain `map.joined` * naive for-in implementation without `reserveCapacity` * few Unsafe variants that should serve as aspirational targets for ideally optimized code * lazy variants * variants for different underlying types: 4 element Array, struct and class in addition to the original 4 element tuple * variants that flatten Sequence instead of Array The tests follow naming convention proposed in swiftlang#20334
1 parent e59cfbc commit bc47e8a

File tree

5 files changed

+1241
-66
lines changed

5 files changed

+1241
-66
lines changed

benchmark/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ set(SWIFT_BENCH_MODULES
8484
single-source/Exclusivity
8585
single-source/ExistentialPerformance
8686
single-source/Fibonacci
87-
single-source/FlattenList
87+
single-source/Flatten
8888
single-source/FloatingPointPrinting
8989
single-source/Hanoi
9090
single-source/Hash
9191
single-source/HashQuadratic
9292
single-source/Histogram
93-
single-source/InsertCharacter
93+
single-source/InsertCharacter
9494
single-source/Integrate
9595
single-source/IterateData
9696
single-source/Join

0 commit comments

Comments
 (0)