mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Add benchmarks that measure KeyPath read and write performance. (#60383)
* Add benchmarks that measure KeyPath read and write performance. * Added setUpFunctions. Revised number of iterations per benchmark. * Include n as a factor in the number of iterations. * Increased number of iterations for KeyPathDirectAccess by a factor of 25. * One last tweak to the number of iterations on testDirectAccess to get them above 20 us. * Made revisions based on feedback. Added three new benchmarks. * Added benchmarks to exhaustively benchmark all KeyPathComponent types. Removed benchmarks dealing with an inlining issue. * Wrapped additional keypaths with identity() where needed. More cleanup and documentation. * Moved KeyPaths for KeyPathRead and Write into FixedSizeArrayHolder. Renamed GetSet to Getset. * Added inline(never) to both versions of getKeypathToElement(). * Moved identity() wraps so that they're called once per variable per benchmark. * Moving destinationKeyPaths into FixedSizeArrayHolder to try to reduce long setup overhead errors. * Additional moving of the identity() wrapping into the singleton's init() to try to reduce setup time errors.
This commit is contained in:
@@ -106,6 +106,7 @@ set(SWIFT_BENCH_MODULES
|
||||
single-source/Integrate
|
||||
single-source/IterateData
|
||||
single-source/Join
|
||||
single-source/KeyPathPerformanceTests
|
||||
single-source/LazyFilter
|
||||
single-source/LinkedList
|
||||
single-source/LuhnAlgoEager
|
||||
|
||||
1701
benchmark/single-source/KeyPathPerformanceTests.swift
Normal file
1701
benchmark/single-source/KeyPathPerformanceTests.swift
Normal file
File diff suppressed because it is too large
Load Diff
@@ -97,6 +97,7 @@ import IntegerParsing
|
||||
import Integrate
|
||||
import IterateData
|
||||
import Join
|
||||
import KeyPathPerformanceTests
|
||||
import LazyFilter
|
||||
import LinkedList
|
||||
import LuhnAlgoEager
|
||||
@@ -279,6 +280,7 @@ register(Integrate.benchmarks)
|
||||
register(IterateData.benchmarks)
|
||||
register(Join.benchmarks)
|
||||
register(LazyFilter.benchmarks)
|
||||
register(KeyPathPerformanceTests.benchmarks)
|
||||
register(LinkedList.benchmarks)
|
||||
register(LuhnAlgoEager.benchmarks)
|
||||
register(LuhnAlgoLazy.benchmarks)
|
||||
|
||||
Reference in New Issue
Block a user