Skip to content

Commit 730bf24

Browse files
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.
1 parent 18a211c commit 730bf24

File tree

3 files changed

+1704
-0
lines changed

3 files changed

+1704
-0
lines changed

benchmark/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ set(SWIFT_BENCH_MODULES
106106
single-source/Integrate
107107
single-source/IterateData
108108
single-source/Join
109+
single-source/KeyPathPerformanceTests
109110
single-source/LazyFilter
110111
single-source/LinkedList
111112
single-source/LuhnAlgoEager

0 commit comments

Comments
 (0)