message: tweak the benchmarks to make them a bit more stable
  I observed high variations between runs on my laptop. This may just be
  because my CPU heats up or because my computer already runs gnome,
  emacs and a bunch of other services. With these settings, the
  benchmarks seem a bit more stable
diff: @@ -70,20 +70,23 @@ pub fn emit_sum(c: &mut Criterion) {
  let buf_len = sum_message.buffer_length();
  let mut pre_allocated_buf = vec![0; buf_len];
  - c.bench_function("compute buffer length", |b| {
  + // the benchmarks run under 20 ns. The results for such
  + // benchmarks can vary a bit more so we:
  + // - eliminate outliers a bit more aggressively (confidence level)
  + // - increase the noise threshold
  + //
  + // Note: criterion always reports p = 0.0 so lowering the
  + // significance level doesn't change anything
  + let mut bench = c.benchmark_group("emit_sum");
  + bench.confidence_level(0.9).noise_threshold(0.05);
  +
  + bench.bench_function("compute buffer length", |b| {
  b.iter(|| black_box(&sum_message).buffer_length())
  });
  - c.bench_function("emit sum message without allocation", |b| {
  + bench.bench_function("emit sum message", |b| {
  b.iter(|| sum_message.to_bytes(black_box(&mut pre_allocated_buf), black_box(&sk)))
  });
  -
  - c.bench_function("emit sum message with allocation", |b| {
  - b.iter(|| {
  - let mut buf = vec![0; buf_len];
  - sum_message.to_bytes(black_box(&mut buf), black_box(&sk));
  - })
  - });
  }
  pub fn parse_sum(c: &mut Criterion) {
  @@ -91,7 +94,11 @@ pub fn parse_sum(c: &mut Criterion) {
  let mut bytes = vec![0; sum_message.buffer_length()];
  sum_message.to_bytes(&mut bytes, &message::participant_sk());
  - c.bench_function("parse from slice", |b| {
  + // This benchmark is also quite unstable so make it a bit more
  + // relaxed
  + let mut bench = c.benchmark_group("parse_sum");
  + bench.confidence_level(0.9).noise_threshold(0.05);
  + bench.bench_function("parse from slice", |b| {
  b.iter(|| Message::from_byte_slice(&black_box(bytes.as_slice())))
  });
  }
  