ordo-one / package-benchmark

Swift benchmark runner with many performance metrics and great CI support
Apache License 2.0
327 stars 25 forks source link

Add ARC traffic as a metric #115

Closed hassila closed 1 year ago

hassila commented 1 year ago

Try to hooking swift_retain/swift_release to allow capturing of ARC traffic as a metric.

hassila commented 1 year ago

Some possible hints:

https://github.com/apple/swift-async-algorithms/blob/main/Sources/_CAsyncSequenceValidationSupport/_CAsyncSequenceValidationSupport.h

https://github.com/apple/swift/blob/b123204b928b00db1b3ea81fe1a85a314825624e/stdlib/public/runtime/HeapObject.cpp

https://github.com/apple/swift/blob/b123204b928b00db1b3ea81fe1a85a314825624e/include/swift/Runtime/InstrumentsSupport.h

hassila commented 1 year ago

Thinking multiple possible metrics:

retain release retain/release delta (would be positive for cycles, should be zero for well behaving code)