#![feature(test)]

extern crate test;
use sum_of_array_singles::repeats;
use test::{black_box, Bencher};

#[bench]
fn bench(bencher: &mut Bencher) {
    let arr = black_box(&[
        -382, 470, -320, 251, -175, -90, -371, 298, 11, -11, -330, -145, 7, 1, -67, -283, 431,
        -330, -24, 131, -232, -143, 448, -407, -337, -168, 353, -219, 75, -457, -349, 382, 174,
        -266, -24, 470, 75, -219, -371, -179, 286, 143, 155, 365, 264, -121, -418, -111, -421, 451,
        404, -103, -426, 41, 248, 353, -168, 427, -382, -320, 170, 465, 293, -32, 254, 367, 492,
        -357, 29, 97, 254, -424, 293, -129, 1, 340, -418, 64, -457, 26, -340, -389, -386, 465,
        -279, 317, -117, -108, 340, -175, -318, 125, 77, -24, 251, -23, 232, 475, -392, 151, 280,
        -454, 97, 276, -101, 75, 379, 477, -215, 317, -314, -401, -188, 400, -349, 231, 248, 431,
        -232, -121, 143, 20, -96, -454, 205, -167, 341, 195, -405, 20, 77, -112, 0, 425, 222, -349,
        -108, -82, -280, -204, 470, 181, 167, -79, 3, -9, 96, 335, -403, -382, -179, -456, -404,
        245, 231, 324, -498, 51, -82, -145, -263, 67, 455, -401, 437, 177, -182, -194, -23, 11,
        -198, 136, 264, 425, 273, 126, 125, -478, 352, 130, 349, 221, -426, -50, 300, 365, 167,
        -123, 222, 483, -387, -86, -123, -498, -411, -337, 341, 225, 121, 131, 159, 341, -19, -314,
        26, -266, -278, -101, 352, -103, -357, -54, -338, -16, -279, -117, 264, -218, -454, -80,
        -140, 204, 492, -129, -19, -389, -346, 451, 31, 399, -136, 310, -454, -125, -279, -392,
        -76, 3, 404, -237, -327, -237, -237, -168, -161, -96, -125, -125, -62, -252, -191, 353,
        -345, -281, -237, 235, 154, 174, -140, 271, -108, 1, -149, -23, -283, -318, -327, -288,
        300, 95, -171, 477, -167, 286, -288, -243, 213, 278, -424, 248, 483, -23, 301, -149, 373,
        64, -404, -73, -331, -194, -238, 455, 488, 310, -338, 248, -101, -86, 102, -375, 180, -421,
        115, -454, 245, -237, -478, -191, -309, 302, 110, -280, -278, -16, 231, -478, 373, -401,
        -24, 165, -32, -221, 108, 107, -125, -175, -314, 186, -62, 232, -337, 349, 461, 221, 278,
        -456, 280, 162, 126, 337, 228, 38, 38, 301, 155, -221, -440, -452, -290, -478, -143, 222,
        -76, 399, -338, -331, -387, -345, -54, -243, -314, -172, 276, -198, 248, -201, 455, 51,
        181, -201, -11, 97, 41, -309, -440, -182, -172, 437, -340, 400, 298, -204, -303, 97, -375,
        367, -9, 136, -73, -215, -171, 427, -281, -405, 488, -75, -191, 154, 455, -66, 231, -75,
        -349, 165, -168, -407, 195, 264, 107, -303, 335, 96, -303, 341, -24, 235, 186, 337, -182,
        228, -403, 151, -191, 50, -63, -346, 205, -263, 267, -79, -175, -479, 67, 110, -386, -136,
        -161, -67, 177, 382, 475, -411, 121, 95, -101, 470, 306, -479, -290, -50, 302, 102, 180,
        130, -79, -337, 411, 383, -66, -112, -188, -454, 108, -323, 115, -338, 267, 84, -108, -24,
        7, 159, 306, -252, -79, 273, -452, 353, -111, -279, -182, 204, 162, -237, -303, -238, 222,
        31, 351, 383, 29, 170, 379, 248, 75, -63, 225, 213, 271, -382, 411, 448, 324, -218, -401,
        84, 50, 351, -323, 461, -90, -80,
    ]);
    bencher.iter(|| repeats(arr));
}
