-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
specialize on chunk size & benchmark vs. old radix (passing)
- Loading branch information
1 parent
85b2ac5
commit 6c960fd
Showing
3 changed files
with
39 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using SortMark, SortingAlgorithms | ||
using Base.Sort | ||
using Base.Order | ||
|
||
struct RawRadixSort2Alg <: Algorithm end | ||
const RawRadixSort2 = RawRadixSort2Alg() | ||
function Base.sort!(v::AbstractVector{<:Unsigned}, lo::Integer, hi::Integer, ::RawRadixSort3Alg, o::ForwardOrdering) | ||
#compression, bits, chunk_size = heuristic(typemin(eltype(v)), typemax(eltype(v)), hi-lo+1) | ||
out = SortingAlgorithms.radix_sort!(v, similar(v), lo, hi, unsigned(8*sizeof(eltype(v))), Val(0xb)) | ||
out === v || copyto!(v, out) | ||
v | ||
end | ||
|
||
df = SortMark.make_df([RawRadixSort2, RadixSort], | ||
Types=[UInt128], orders=[Base.Order.Forward], | ||
lens=SortMark.lengths(2, 10_000_000, 3), | ||
sources=Dict(:simple=>SortMark.sources[:simple]), | ||
seconds=nothing, samples=30) | ||
compute!(df) | ||
stat!(df) | ||
#df.samples[df.pvalue .>= .01] .*= 3 | ||
#compute!(df[df.pvalue .>= .01, :]) | ||
#stat!(df) | ||
display(df[:, [:len, :Type, :pvalue, :point_estimate, :confint]]) | ||
x = df[df.worst_first, :] | ||
x = df[df.Type .== UInt128, :] | ||
display(x[:, [:len, :Type, :pvalue, :point_estimate, :confint]]) | ||
#display(df[sortperm(df.len), [:len, :Type, :pvalue, :point_estimate, :confint]]) | ||
plot(log10.(df.len), first.(df.confint)) | ||
plot!(log10.(df.len), last.(df.confint), legend=false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters