Documentation
¶
Overview ¶
Command rtcompare-example compares two ways of sorting a slice, the generic slices.Sort and sort.Slice with a comparison closure, and reports whether the difference between them is one this machine can actually resolve.
The comparison itself is the least interesting part. What the example is really about is everything around it: sizing the batches so that a difference below the clock's resolution is measurable at all, finding out what the harness invents on its own before trusting it, and noticing that the two candidates are not equally well behaved. rtcompare.Compare does all of that in one call and reports what it decided, which is what the first half of this program shows. The second half takes the same measurements apart by hand, for when the summary is not enough.