This is probably related to Guide on writing benchmarking tasks · Issue #7 · apple/swift-collections-benchmark · GitHub -
I was converting some code the other day, and wanted to know it's performance impact - so I reached for this codebase to try it out.
The code was replacing one locking system with another - so I wanted to look at the difference. I tried to use addSimple matching the existing, but I'm fairly certain that I'm holding it wrong.
The sample code that I was poking at is available at NetNewsWire/main.swift at lock_benchmark · heckj/NetNewsWire · GitHub, and the resulting comparison chart:
I fumbled around sufficiently to figure out I needed to register how to create my own type (since I was working with a String input), but I hadn't followed the code through how it all worked sufficient to really know what was being captured and measured (or not) between the two comparisons.
The surprise to me wasn't that there was a tiny gap, but that the time decreased with size - I expected these to be pretty much constant time scenarios, so I was expecting two more-or-less horizontal lines.
I'm clearly missing something, advice?