News for hackers. Stuff that matters.
Re:Ruby Benchmark by cheald on Sunday August 01, 2010 @08:54PM (#1566497)
GC should be disabled for proper benchmarks anyhow, honestly. Or at least measured. REE has handy switches to measure that sort of thing.
Re:Ruby Benchmark by rue on Monday August 02, 2010 @09:23AM (#1567557)
Disabling the GC means your benchmark is worthless.

1. Valid GC during execution: you are removing an actual factor;

2. "Invalid" i.e. unrelated GC during execution: your benchmark is too narrow in scope.

Re:Ruby Benchmark by cheald on Monday August 02, 2010 @06:03PM (#1569260)
It depends on what you're benchmarking. If you're benching wall time, then yes, you need to have GC on, and you need to do a ridiculous number of iterations to average out GC runtimes. You also need to invoke the GC before you begin your benchmark; doing a collection pass early in the benchmark for all the objects created on startup/setup skews the benchmark.

Separate benchmarks should be conducted for execution speed (CPU time) and garbage generation. Saying "X is faster than Y" tends to suggest a CPU time benchmark. "X is faster than Y with W delta garbage and Z delta less time spent in GC" suggests a proper wall time benchmark.

Re:Ruby Benchmark by Groxx on Monday August 02, 2010 @10:01AM (#1567657)
On the other hand, 10k+ iterations likely isn't anything you normally experience, and may incur abnormal GC cost due to the sheer number. Though that's typically detectable by doing multiple sizes of tests.