-
Change
gauge_rdtsc
to returnmach_absolute_time
on macOS. This is a portable way of returning the number of CPU cycles that works on both Intel- and ARM-based Macs. -
Change
gauge_gettime
to useclock_gettime_nsec_np
instead ofmach_absolute_time
on macOS. Whilemach_absolute_time
has nanosecond resolution on Intel-based Macs, this is not the case on ARM-based Macs, so the previousmach_absolute_time
-based implementation would return incorrect timing results on Apple silicon.There are two minor consequences of this change:
-
Gauge now only supports macOS 10.02 or later, as that is the first version to have
clock_gettime_nsec_np
. As macOS 10.02 was released in 2002, this is unlikely to affect users, but please speak up if this is a problem for you. -
As
clock_gettime_nsec_np
does not require any special initialization code,gauge_inittime
is now a no-op on macOS. If you manually invoke thegetTime
function in your code, however, it is still important that youinitializeTime
beforehand, as this is still required for the Windows implementation to work correctly.
-
- Add GHCJS support (statistical analysis is not supported)
- Fix issue with perRunEnv
- Drop support for GHC 7.8
-
Enhancement
: AddnfAppIO
andwhnfAppIO
functions, which take a function and its argument separately likenf
/whnf
, but whose function returnsIO
likenfIO
/whnfIO
. This is useful for benchmarking functions in which the bulk of the work is not bound by IO, but by pure computations that might otherwise be optimized away if the argument is known statically. -
Bug Fix
: Pass-m exact
option to the child processes used to run benchmarks in an isolated manner. This avoids running a wrong benchmark due to the default prefix match.
- Add a new benchmark matching option "-m exact" to match the benchmark name exactly.
- Write data to CSV file in quick mode too.
- Fix the CSV file header to match with the data rows for the
--csvraw
case. - Fix issue with GC metrics in 32 bits that would silently wrap and failure in optional machinery.
- Simplify dependencies in tests using foudation checks.
- Inline math-functions & mwc-random:
- Remove most functions, instances and types, that are unnecessary for gauge
- Remove unsafe seeding with partial seed (unused in gauge anyway)
- Remove vector-th-unbox dependency (transitively template-haskell, pretty, ghc-boot-th)
- Remove time dependency
- Re-add Gauge.Benchmark to Gauge.Main to keep the transition between criterion and gauge easy
- Fix cycles reporting on linux, osx and windows
- Add some extra callstack for reporting on partial function
- Fix compilation with Semigroup => Monoid (compilation on 8.4). still unsupported
- Add some color on terminal output
Usability
: Simplify and organize the documentation and user APIs.Functionality
:- Add measurement and reporting of more performance counters on Unices (collected via getrusage) for example page faults, user time, system time and rss are now available in verbose mode.
- Re-enable CSV analysis with the same output format as criterion (
--csv
) - Add CSV measurement dumping with
--csvraw
Control
: Provide better control over measurement process with--min-samples
,--min-duration
and--include-first-iter
flags.Speed:
Add--quick
flag that provides results much faster (10x) without using statistical analysis.- Reliability:
- Fix a bug in GC stats collection and reporting with GHC 8.2 that caused incorrect reporting of some GC stats.
- Fix a bug in statistical regression that caused incorrect reporting of mean and other stats.
- Improve reliability by isolating benchmarks from one another using the
--measure-with
flag. The results of one benchmark are no longer affected by other benchmarks because each benchmark runs in a separate process. - Introduce an optional value type
Optional
with an efficient runtime representation to replace the ad-hoc fromXXX functions and the untyped approach.
- Modularity:
- Introduce
--measure-only
flag that allows just measurement and no analysis or reporting. - Provide modular build, measurement code is cleanly separated from
statistical analysis code. As a result a leaner version can now be built
without analysis code (controlled by the
analysis
build flag). - Clean, refactor & rewrite source code
- Introduce
- Remove code-page dependency
- Simplify monad handling, remove foundation as dependency
- condensed display with
--small
- remove optparse-applicative
- remove bunch of dependencies
- initial import of criterion-1.2.2.0