mallocCountTotal
Number of small+large mallocs
case mallocCountTotalNumber of small+large mallocs
case mallocCountTotalimport BenchmarkBenchmark allows you to easily create sophisticated Swift performance benchmarks
enum BenchmarkMetricMetrics supported by benchmark.
case peakMemoryResidentMeasure resident memory usage - sampled during runtime
case peakMemoryResidentDeltaMeasure resident memory usage - sampled during runtime (subtracting start of benchmark baseline resident amount)
case peakMemoryVirtualMeasure virtual memory usage - sampled during runtime
case mallocCountSmallNumber of small malloc calls
case mallocCountLargeNumber of large malloc calls
case memoryLeakedNumber of small+large mallocs - small+large frees in resident memory
case allocatedResidentMemoryThe amount of allocated resident memory according to the memory allocator by the application (does not include metadata overhead etc)
case cpuUserCPU user space time spent for running the test
case cpuSystemCPU system time spent for running the test
case cpuTotalCPU total time spent for running the test (system + user)
case wallClockWall clock time for running the test
case throughputOperations / second, .prefersLarger
case syscallsMeasure number of syscalls made during the test
case contextSwitchesMeasure number of context switches made during the test
case threadsSample the maximum number of threads in the process under the test (not exact)
case threadsRunningSample the maximum number of threads actually running under the test (not exact)
case readSyscallsThe number of I/O read syscalls performed e.g. read(2) / pread(2) – Linux only
case writeSyscallsThe number of I/O write syscalls performed e.g. write(2) / pwrite(2) – Linux only
case readBytesLogicalThe number of bytes read from storage (but may be satisfied by pagecache!) – Linux only
case writeBytesLogicalThe number bytes written to storage (but may be cached) – Linux only
case readBytesPhysicalThe number of bytes physically read from a block device (i.e. disk) – Linux only
case writeBytesPhysicalThe number of bytes physicall written to a block device (i.e. disk) – Linux only
case instructionsThe number instructions executed
case objectAllocCountNumber of object allocations (implicit retain of one) (ARC)
case retainCountNumber of retains (ARC)
case releaseCountNumber of releases (ARC)
case retainReleaseDeltaABS(retains-releases) - if this is non-zero, it would typically mean the benchmark has a retain cycle (use Memory Graph Debugger to troubleshoot) or that startMeasurement/stopMeasurement aren’t used properly
case custom(_: String, polarity: BenchmarkMetric.Polarity = .prefersSmaller, useScalingFactor: Bool = true)Custom metric
case deltaUsed internally as placeholders for formatting deltas in an easy way, please don’t use
case deltaPercentage