#![feature(test)]

extern crate test;
extern crate seahash;

#[bench]
fn gigabyte(b: &mut test::Bencher) {
    b.iter(|| {
        let mut x = 0;
        let mut buf = [15; 4096];

        for _ in 0..250000 {
            x ^= seahash::hash(&buf);
            buf[0] += buf[0].wrapping_add(1);
        }

        x
    })
}

#![feature(test)]

extern crate test;
extern crate seahash;

#[bench]
fn gigabyte(b: &mut test::Bencher) {
    b.iter(|| {
        let mut x = 0;
        let mut buf = [15; 4096];

        for _ in 0..250000 {
            x ^= seahash::hash(&buf);
            buf[x as usize % 4096] += 1;
        }

        x
    })
}

--- 
+++ 
@@ -11,7 +11,7 @@
 
         for _ in 0..250000 {
             x ^= seahash::hash(&buf);
-            buf[x as usize % 4096] += 1;
+            buf[0] += buf[0].wrapping_add(1);
         }
 
         x
Make the benchmarking cheaper (more accurate).
