Skip to content

Commit

Permalink
Update perf
Browse files Browse the repository at this point in the history
  • Loading branch information
Licenser committed Oct 30, 2019
1 parent b0b4e49 commit f40a712
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/perf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use std::env;

#[cfg(feature = "perf")]
mod int {
const ROUNDS: usize = 10000;
const WARMUP: usize = 2000;
const ROUNDS: usize = 2000;
const WARMUP: usize = 200;
use colored::*;
use perfcnt::linux::{HardwareEventType, PerfCounterBuilderLinux};
use perfcnt::{AbstractPerfCounter, PerfCounter};
Expand Down Expand Up @@ -164,15 +164,15 @@ mod int {
// Run some warmup;

for mut bytes in &mut data_entries[..WARMUP as usize] {
simd_json::to_borrowed_value(&mut bytes).unwrap();
simd_json::deserialize_borrowed_value(&mut bytes).unwrap();
}
let mut stats = Stats::default();
for mut bytes in &mut data_entries[WARMUP as usize..] {
// Set up counters
let pc = stats.start();

// run the measurement
let r = simd_json::to_borrowed_value(&mut bytes);
let r = simd_json::deserialize_borrowed_value(&mut bytes);
// Stop counters
stats.stop(pc);
// we make sure that dropping doesn't happen untill we are done with our counting.
Expand Down

0 comments on commit f40a712

Please sign in to comment.