rtcompare-example

command
v0.8.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 5 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL