Commit Graph

14 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
tbkka
2c8ae98e5e Python3 compatibility for Benchmarks (#33039)
Three issues addressed here:

1. Dependency on dictionary iteration order

 CharacterProperties.swift.gyb iterated a dictionary to produce its output.
 Changed this to a list of tuples to ensure the order is predictable.

2. Python3 `map` returns an iterator, not a list

 Changed a bunch of `map` calls to `list(map(...))` to ensure the result is a list

3. Python3 `int()` expects a string, won't accept a list of characters

 Added a concatenation step that is effectively a no-op on Python2
2020-07-22 12:24:10 -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