Skip to content

Would you be willing to benchmark agains Julia's default sorting algorithm? #2

@LilithHafner

Description

@LilithHafner

@jariji shared the existence of rhsort with me here LilithHafner/InterLanguageSortingComparisons#10. I ran the benchmarks in gcc bench.c -o bench && ./bench and what I think are equivalent benchmarks in Julia. I found that Julia's default sorting is 2x faster than rhsort in that particular case. If you're willing I'd appreciate your confirmation to refutation of those results. I benchmarked Julia's sorting with this code snippet that can be pasted into the Julia REPL:

using BenchmarkTools, Random, Printf
for n in 10 .^ (3:6)
    v = rand(Int32, n)
    result = @benchmark sort($v) setup=(rand!($v)) evals=1 gctrial=false samples=3e7/n
    @printf "Testing size %8i: best: %6.3f avg: %6.3f ns/v\n" n minimum(result.times)/n mean(result.times)/n
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions