Running benchmarks with rehearsal and garbage collection

The Bmbm method is used exactly like the Bm method. The difference is in how it runs the measurements, and in what output it produces.

Sometimes benchmark results are skewed because code executed earlier encounters different garbage collection overheads than that run later. Bmbm attempts to minimize this effect by running the tests twice, the first time as a rehearsal in order to get the runtime environment stable, the second time for real. Garbage collection is executed before the start of each of the real timings; the cost of this is not included in the timings. In reality, though, there‘s only so much that Bmbm can do, and the results are not guaranteed to be isolated from garbage collection and other effects.

Remarks: The Bmbm method returns an Enumeration of measurements (as of version 0.2). These are the results from the real executions, the rehearsals are not returned.

See also

Last edited Jan 27, 2010 at 7:32 AM by tormaroe, version 6


No comments yet.