Skip to content

Instantly share code, notes, and snippets.

View edhana's full-sized avatar

Eduardo Marques edhana

  • Zendesk
  • Melbourne, Australia
View GitHub Profile
@pglombardo
pglombardo / measure.md
Last active February 23, 2024 00:02
Comprehensive Guide to Ruby Performance Benchmarking

GC.disable

Wall Clock Time versus CPU Time

An important difference to note is the how time is reported by various measurement methods. Wall clock time is the actual time passed in terms of human perception whereas CPU time is the time spent processing the work. CPU time doesn't include any delays waiting on resources to free up such as thread interrupts or garbage collection.

The Work to Measure

To keep things simple, we'll create a Ruby Proc and just repeatedly call that Proc for each of the measurement methods below.