Commit Graph

23 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
Pavol Vaskovic
cdc47f682f [benchmark] Fix Existential.Array.Mutating SO
Mask the setup overhead from copying of existential array in `Existential.Array.Mutating` by increasing the workload (5x). This way the overhead of copying is less than 5%.

Remove the misguided attempt at solving this problem with `grabArray` method - there is no way to avoid this overhead because every sample should start from a fresh copy.
2019-05-06 08:04:18 +02:00
Pavol Vaskovic
776ace0676 [benchmark] Disable ExistentialPerformance
Don’t run the ExistentialPerformance benchmarks as part of the pre-commit suite.
2019-02-12 21:17:31 +01:00
Pavol Vaskovic
b61a63d16a [benchmark] Add docs & adjust loop multipliers
Bumping up the multipliers to get above 20 μs runtime.
2019-02-07 15:14:32 +01:00
Pavol Vaskovic
0ac591e27b [benchmark] Add .existential BenchmarkCategory 2019-02-06 12:38:50 +01:00
Pavol Vaskovic
35163f19c7 [benchmark] Refactor: Despecialized Existential
The technique from preceding commit, can be used to fully determine the tested type variant in the `setUpFunction` and use a non-generic `runFunction`s for all the benchmarks.

This eliminates 202 lines of boilerplate.
2019-02-06 12:38:49 +01:00
Pavol Vaskovic
5ad2698799 [benchmark] Refactor: type independent variants
Benchmarks from Array group (except the `init`) don’t use the `withType` parameter from the `run_` function anymore. The type specific variation is taken care of in the `BenchmarkInfo`, since the `existentialArray` with appropriate type is created by the `setUpFunction`. This means we can reuse the same non-generic `run_ ` function for the whole group and eliminate all the specialized `runFunction` variants.

This eliminates 144 lines of boilerplate.
2019-02-06 12:38:49 +01:00
Pavol Vaskovic
6b29523f0c [benchmark] Gardening: 80 col Existential
Break up BenchmarkInfo into 2 lines to fit 80 column line limit.
2019-02-06 12:38:49 +01:00
Pavol Vaskovic
2702633386 [benchmark] Extract setup from Existential.Array
Existential.Array group had setup overhead caused by initialization of the existential array. Since this seems to be quite substatial and is dependant on the existential type, it makes sense to add Array.init benchmark group that will measure it explicitly.

Array setup is extracted into 9 type-specific functions. The setup inside the `run_` functions now grabs that array, prepared in `setUpFunction`, excluding the initialization from the measurement.

This helped with extracting setup overhead from most cases, but it appears that the mutable test still have measurable overhead because they perform COW. I’ve tried to work around this by transfering ownership of the pre-initialized array with the `grabArray` function, but nilling the IUO was crashing at runtime. This should be fixed later.
2019-02-06 12:38:48 +01:00
Pavol Vaskovic
06cf0c898b [benchmark] Existential: shorter names
Renamed tests according to the naming convention proposed in PR #20334.

They now fit the 40 character limit and are structured into groups and variants.

Also extracted tags into 2 constants, to simplify the [BenchmarkInfo] expression.
2019-02-06 12:38:48 +01:00
Pavol Vaskovic
5bbb9ff509 [benchmark] Gardening: BenchmarkInfo order
Sanity refactoring:
* Generate `BenchmarkInfo` in the same order as run loops.
* Generate `IntValueBuffer0`, too.
* Minor code formatting tweeks.
2019-02-06 12:38:48 +01:00
Pavol Vaskovic
1bd702a24c [benchmark] GYB ExistentialPerformance
Painstakingly reverse-engineered the boilerplate generator, that produces ExistentialPerformance.swift (sans few whitespace differences), to ease maintanance (The upcoming refactoring).
2019-02-06 12:38:47 +01:00
Pavol Vaskovic
ae4ecbe8b6 [benchmark] Adjust Existential workload sizes
Reduced base workloads. This allows precise measurements without the noise of accumulated error from unnecessarily long runtimes.
2019-02-06 12:38:47 +01:00
Pavol Vaskovic
94d94ee2f5 [benchmark] Rehouse DistinctClassFieldAccesses
Benchmark DistinctClassFieldAccesses was added in a strange place…
See https://github.com/apple/swift/pull/18892/files#r212038958

Per discussion in in https://github.com/apple/swift/pull/18892#issuecomment-435695071
I’m moving it to the extremely similar `ArrayInClass`, while fixing its workload size (and loop pattern) to make it relatively comparable.
2019-02-06 12:38:47 +01:00
Pavol Vaskovic
63143d8c3f [benchmark] Extr. Setup DistinctClassFieldAccesses
DistinctClassFieldAccesses had setup overhead of 4 μs (14%).
Plus cosmetic code formatting fix.
2018-10-23 22:33:16 +02:00
Joe Shajrawi
5e7ea888fb [Exclusivity] Teach MemAccessUtils about Projection Paths
Consider a class ‘C’ with distinct fields ‘A’ and ‘B’

And consider we are accessing C.A and C.B inside a loop

LICM well not hoist the exclusivity checking outside of the loop because isDistinctFrom(C.A, C.B) returns false.

This is because the helper function bails if isUniquelyIdentified returns false (which is the case in class kinds)

Same with all other potential access enforcement optimizations.

This PR resolves that
2018-08-22 18:11:55 -07:00
Max Moiseev
1dd9d61ded Move all benchmarks to use registerBenchmark and BenchmarkInfo 2017-10-03 18:04:56 -07:00
Erik Eckstein
9e432294e1 benchmarks: fix warnings
rdar://problem/33660902
2017-08-01 17:47:16 -07:00
Arnold Schwaighofer
91882b44fa Merge pull request #8408 from aschwaighofer/fix_benchmark_to_work_with_scripts
Fix benchmark for generate script
2017-03-29 08:13:35 -07:00
Arnold Schwaighofer
3c83ea6761 Fix benchmark for generate script 2017-03-29 05:35:48 -07:00
practicalswift
377e534239 [gardening] Add missing copyright notice 2017-03-28 21:43:00 +02:00
Arnold Schwaighofer
f5cf0aa5d6 Add existential performance benchmarks 2017-03-27 11:32:47 -07:00