lakwet / voracious_sort

Voracious radix sort
MIT License
61 stars 2 forks source link

'Almost descending' benchmark is actually almost ascending #13

Closed NicholasGorski closed 10 months ago

NicholasGorski commented 1 year ago

For reference, from helper_random_array_almost_desc_u32:

    let mut array = helper_random_array_descending_u32(size);
    array.reverse();

    for _ in 0..((size as f64).log2() as usize) {
        let i = rng.gen_range(0, size);
        let j = rng.gen_range(0, size);
        array.swap(i, j);
    }

The array.reverse() undoes the reversal in helper_random_array_descending_u32; looks like this ends up being equivalent to helper_random_array_almost_asc_u32?

lakwet commented 10 months ago

Oh yes, indeed, thanks you

lakwet commented 10 months ago

It should be fixed, but I haven't re run the benchmarks.

Commit