Skip to content

Commit a084b33

Browse files
committed
updated to 0.3.1 removing support for Int etc
1 parent 5cda27e commit a084b33

18 files changed

+1900
-687
lines changed

Manifest.toml

+29-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
# This file is machine-generated - editing it directly is not advised
22

3-
julia_version = "1.10.4"
3+
julia_version = "1.11.0-rc3"
44
manifest_format = "2.0"
5-
project_hash = "4352c645febe0561f79d16d2b1ac56a45920a3d0"
5+
project_hash = "77279a8ad546ad0c5e3723b7d77f8d51b314fbce"
66

77
[[deps.Artifacts]]
88
uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
9+
version = "1.11.0"
910

1011
[[deps.Base64]]
1112
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
13+
version = "1.11.0"
1214

1315
[[deps.CategoricalArrays]]
1416
deps = ["DataAPI", "Future", "Missings", "Printf", "Requires", "Statistics", "Unicode"]
@@ -57,6 +59,7 @@ version = "0.18.20"
5759
[[deps.Dates]]
5860
deps = ["Printf"]
5961
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
62+
version = "1.11.0"
6063

6164
[[deps.DocStringExtensions]]
6265
deps = ["LibGit2"]
@@ -67,10 +70,12 @@ version = "0.9.3"
6770
[[deps.Future]]
6871
deps = ["Random"]
6972
uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820"
73+
version = "1.11.0"
7074

7175
[[deps.InteractiveUtils]]
7276
deps = ["Markdown"]
7377
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
78+
version = "1.11.0"
7479

7580
[[deps.IrrationalConstants]]
7681
git-tree-sha1 = "630b497eafcc20001bba38a4651b327dcfc491d2"
@@ -80,11 +85,12 @@ version = "0.2.2"
8085
[[deps.LibGit2]]
8186
deps = ["Base64", "LibGit2_jll", "NetworkOptions", "Printf", "SHA"]
8287
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
88+
version = "1.11.0"
8389

8490
[[deps.LibGit2_jll]]
8591
deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll"]
8692
uuid = "e37daf67-58a4-590a-8e99-b0245dd2ffc5"
87-
version = "1.6.4+0"
93+
version = "1.7.2+0"
8894

8995
[[deps.LibSSH2_jll]]
9096
deps = ["Artifacts", "Libdl", "MbedTLS_jll"]
@@ -93,10 +99,12 @@ version = "1.11.0+1"
9399

94100
[[deps.Libdl]]
95101
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
102+
version = "1.11.0"
96103

97104
[[deps.LinearAlgebra]]
98105
deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"]
99106
uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
107+
version = "1.11.0"
100108

101109
[[deps.LogExpFunctions]]
102110
deps = ["DocStringExtensions", "IrrationalConstants", "LinearAlgebra"]
@@ -117,11 +125,12 @@ version = "0.3.28"
117125
[[deps.Markdown]]
118126
deps = ["Base64"]
119127
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
128+
version = "1.11.0"
120129

121130
[[deps.MbedTLS_jll]]
122131
deps = ["Artifacts", "Libdl"]
123132
uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"
124-
version = "2.28.2+1"
133+
version = "2.28.6+0"
125134

126135
[[deps.Missings]]
127136
deps = ["DataAPI"]
@@ -136,7 +145,7 @@ version = "1.2.0"
136145
[[deps.OpenBLAS_jll]]
137146
deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"]
138147
uuid = "4536629a-c528-5b80-bd46-f80d51c5b363"
139-
version = "0.3.23+4"
148+
version = "0.3.27+1"
140149

141150
[[deps.OrderedCollections]]
142151
git-tree-sha1 = "dfdf5519f235516220579f949664f1bf44e741c5"
@@ -146,10 +155,12 @@ version = "1.6.3"
146155
[[deps.Printf]]
147156
deps = ["Unicode"]
148157
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"
158+
version = "1.11.0"
149159

150160
[[deps.Random]]
151161
deps = ["SHA"]
152162
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
163+
version = "1.11.0"
153164

154165
[[deps.Requires]]
155166
deps = ["UUIDs"]
@@ -163,6 +174,7 @@ version = "0.7.0"
163174

164175
[[deps.Serialization]]
165176
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
177+
version = "1.11.0"
166178

167179
[[deps.SortingAlgorithms]]
168180
deps = ["DataStructures"]
@@ -173,12 +185,17 @@ version = "1.2.1"
173185
[[deps.SparseArrays]]
174186
deps = ["Libdl", "LinearAlgebra", "Random", "Serialization", "SuiteSparse_jll"]
175187
uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
176-
version = "1.10.0"
188+
version = "1.11.0"
177189

178190
[[deps.Statistics]]
179-
deps = ["LinearAlgebra", "SparseArrays"]
191+
deps = ["LinearAlgebra"]
192+
git-tree-sha1 = "ae3bb1eb3bba077cd276bc5cfc337cc65c3075c0"
180193
uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
181-
version = "1.10.0"
194+
version = "1.11.1"
195+
weakdeps = ["SparseArrays"]
196+
197+
[deps.Statistics.extensions]
198+
SparseArraysExt = ["SparseArrays"]
182199

183200
[[deps.StatsAPI]]
184201
deps = ["LinearAlgebra"]
@@ -195,7 +212,7 @@ version = "0.34.3"
195212
[[deps.SuiteSparse_jll]]
196213
deps = ["Artifacts", "Libdl", "libblastrampoline_jll"]
197214
uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c"
198-
version = "7.2.1+1"
215+
version = "7.7.0+0"
199216

200217
[[deps.TOML]]
201218
deps = ["Dates"]
@@ -205,11 +222,13 @@ version = "1.0.3"
205222
[[deps.UUIDs]]
206223
deps = ["Random", "SHA"]
207224
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
225+
version = "1.11.0"
208226

209227
[[deps.Unicode]]
210228
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
229+
version = "1.11.0"
211230

212231
[[deps.libblastrampoline_jll]]
213232
deps = ["Artifacts", "Libdl"]
214233
uuid = "8e850b90-86db-534c-a0d3-1478176c7d93"
215-
version = "5.8.0+1"
234+
version = "5.11.0+0"

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "SortingLab"
22
uuid = "562c1548-17b8-5b69-83cf-d8aebec229f5"
33
authors = ["Dai ZJ <[email protected]>"]
4-
version = "0.3.0"
4+
version = "0.3.1"
55

66
[deps]
77
CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597"

README.jmd

+11-13
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
title : SortingLab README
33
author : Dai ZJ
4-
date: 2019--09-28
5-
options:
4+
date: 2024--09-21
5+
weave_options:
66
out_path : README.MD
77
doctype : github
88
---
@@ -11,9 +11,9 @@ An alternative implementation of sorting algorithms and APIs. The ultimate aim i
1111

1212
# Faster Sort and Sortperm
1313

14-
The main function exported by SortingLab is `fsort` and `fsortperm` which generally implements faster algorithms than `sort` and `sortperm` for `CategoricalArrays.CategoricalVector`, `Vector{T}`, `Vector{Union{T, Missing}}` where `T` is
14+
The main function exported by SortingLab is `fsort` and `fsortperm` which generally implements faster algorithms than `sort` and `sortperm` for `CategoricalArrays.CategoricalVector`, `Vector{T}`, `Vector{Union{String, Missing}}` where `T` is
1515

16-
* Int*, UInt*, Float*, String
16+
**Update Sep'2024**: SortingLab.jl used to be faster than base on integer sorting which is no longer the case! Well done base!
1717

1818
**Note**: The reason why we restrict the type to `Vector` is that SortingLab.jl assumes something about memory layout and hence `Vector` provides that guarantee in the types supported.
1919

@@ -67,25 +67,24 @@ using SortingLab
6767
@test isequal(fsort(x), sort(x))
6868
```
6969

70-
7170
## Benchmarks
7271
![Base.sort vs SortingLab.radixsort](benchmarks/sort_vs_radixsort.png)
7372

74-
![Base.sort vs SortingLab.radixsort](benchmarks/sortperm_vs_fsortperm.png)
75-
76-
![Base.sort vs SortingLab.fsort](benchmarks/fsort_missing_100m_int.png)
77-
78-
![Base.sortperm vs SortingLab.sortperm](benchmarks/fsortperm_missing_100m_int.png)
73+
#![Base.sort vs SortingLab.radixsort](benchmarks/sortperm_vs_fsortperm.png)
7974

8075
## Benchmarking code
81-
```julia; eval=false
76+
```julia
8277
using SortingLab;
8378
using BenchmarkTools;
8479
import Random: randstring
80+
using Test
81+
using Missings: allowmissing
82+
using Plots, StatsPlots
8583

8684
N = 1_000_000;
8785
K = 100;
8886

87+
# String Sort
8988
svec = rand("id".*string.(1:N÷K, pad=10), N);
9089
sort_id_1m = @belapsed sort($svec);
9190
radixsort_id_1m = @belapsed radixsort($svec);
@@ -100,8 +99,7 @@ radixsort_r_1m = @belapsed radixsort($rsvec);
10099
sortperm_r_1m = @belapsed sortperm($rsvec);
101100
fsortperm_r_1m = @belapsed fsortperm($rsvec);
102101

103-
using Plots
104-
using StatsPlots
102+
105103
groupedbar(
106104
repeat(["IDs", "Random len 32"], inner=2),
107105
[sort_id_1m, radixsort_id_1m, sort_r_1m, radixsort_r_1m],

README.md

+17-8
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
22
author: "Dai ZJ"
33
title: "SortingLab README"
4-
date: "2019--09-28"
4+
date: "2024--09-21"
55
---
66

77
# SortingLab
88
An alternative implementation of sorting algorithms and APIs. The ultimate aim is to contribute back to Julia base or SortingAlgorithms.jl. However, there is commitment to keep this package's API stable and supported, so other developers can rely on the implementation and API here.
99

1010
# Faster Sort and Sortperm
1111

12-
The main function exported by SortingLab is `fsort` and `fsortperm` which generally implements faster algorithms than `sort` and `sortperm` for `CategoricalArrays.CategoricalVector`, `Vector{T}`, `Vector{Union{T, Missing}}` where `T` is
12+
The main function exported by SortingLab is `fsort` and `fsortperm` which generally implements faster algorithms than `sort` and `sortperm` for `CategoricalArrays.CategoricalVector`, `Vector{T}`, `Vector{Union{String, Missing}}` where `T` is
1313

14-
* Int*, UInt*, Float*, String
14+
**Update Sep'2024**: SortingLab.jl used to be faster than base on integer sorting which is no longer the case! Well done base!
1515

1616
**Note**: The reason why we restrict the type to `Vector` is that SortingLab.jl assumes something about memory layout and hence `Vector` provides that guarantee in the types supported.
1717

@@ -97,21 +97,25 @@ Test Passed
9797
## Benchmarks
9898
![Base.sort vs SortingLab.radixsort](benchmarks/sort_vs_radixsort.png)
9999

100-
![Base.sort vs SortingLab.radixsort](benchmarks/sortperm_vs_fsortperm.png)
100+
#![Base.sort vs SortingLab.radixsort](benchmarks/sortperm_vs_fsortperm.png)
101101

102-
![Base.sort vs SortingLab.fsort](benchmarks/fsort_missing_100m_int.png)
102+
![Integer Base.sort vs SortingLab.fsort](benchmarks/int_1m_sort.png)
103103

104-
![Base.sortperm vs SortingLab.sortperm](benchmarks/fsortperm_missing_100m_int.png)
104+
![Integer Base.sort vs SortingLab.fsort](benchmarks/int_1m_sortperm.png)
105105

106106
## Benchmarking code
107107
```julia
108108
using SortingLab;
109109
using BenchmarkTools;
110110
import Random: randstring
111+
using Test
112+
using Missings: allowmissing
113+
using Plots, StatsPlots
111114

112115
N = 1_000_000;
113116
K = 100;
114117

118+
# String Sort
115119
svec = rand("id".*string.(1:N÷K, pad=10), N);
116120
sort_id_1m = @belapsed sort($svec);
117121
radixsort_id_1m = @belapsed radixsort($svec);
@@ -126,8 +130,7 @@ radixsort_r_1m = @belapsed radixsort($rsvec);
126130
sortperm_r_1m = @belapsed sortperm($rsvec);
127131
fsortperm_r_1m = @belapsed fsortperm($rsvec);
128132

129-
using Plots
130-
using StatsPlots
133+
131134
groupedbar(
132135
repeat(["IDs", "Random len 32"], inner=2),
133136
[sort_id_1m, radixsort_id_1m, sort_r_1m, radixsort_r_1m],
@@ -143,6 +146,12 @@ groupedbar(
143146
savefig("benchmarks/sortperm_vs_fsortperm.png")
144147
```
145148

149+
```
150+
"C:\\git\\SortingLab\\benchmarks\\sortperm_vs_fsortperm.png"
151+
```
152+
153+
154+
146155

147156

148157
# Similar package
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# sort integer with missing
2+
x = allowmissing(rand(1:10_000, 1_000_000))
3+
x[rand(1:length(x), 100_000)] .= missing
4+
@test isequal(fsort(x), sort(x))
5+
6+
int_missing_fsort_timing = @belapsed fsort(x);
7+
int_missing_sort_timing = @belapsed sort(x);
8+
9+
# sort integer without missing
10+
xx = rand(1:10_000, 1_000_000)
11+
int_fsort_timing = @belapsed fsort(xx)
12+
int_missing_sort_timing = @belapsed sort(xx)
13+
14+
groupedbar(
15+
repeat(["1m Integer w missing", "1m Integer wo missing"], inner=2),
16+
[int_missing_sort_timing, int_missing_fsort_timing, int_missing_sort_timing, int_fsort_timing],
17+
group=repeat(["Base.sort", "SortingLab.fsort"], outer=2),
18+
title="Intger sort (1m rows): Base vs SortingLab")
19+
savefig("benchmarks/int_1m_sort.png")
20+
21+
22+
int_missing_fsortperm_timing = @belapsed fsortperm(x);
23+
int_missing_sortperm_timing = @belapsed sortperm(x);
24+
25+
int_fsortperm_timing = @belapsed fsortperm(xx)
26+
int_missing_sortperm_timing = @belapsed sortperm(xx)
27+
28+
groupedbar(
29+
repeat(["1m Integer w missing", "1m Integer wo missing"], inner=2),
30+
[int_missing_sortperm_timing, int_missing_fsortperm_timing, int_missing_sortperm_timing, int_fsortperm_timing],
31+
group=repeat(["Base.sort", "SortingLab.fsort"], outer=2),
32+
title="Intger sortperm (1m rows): Base vs SortingLab")
33+
savefig("benchmarks/int_1m_sortperm.png")

benchmarks/fsort_missing_100m_int.png

-13.3 KB
Binary file not shown.
-14.9 KB
Binary file not shown.

benchmarks/sort_vs_radixsort.png

6.66 KB
Loading

benchmarks/sortperm_vs_fsortperm.png

7.45 KB
Loading

build-readme.jl

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Weave readme
22
using Pkg
3-
cd("c:/git/SortingLab/")
4-
Pkg.activate("c:/git/SortingLab/readme-env")
3+
Pkg.activate("readme-env")
54
Pkg.update()
65

76
using Weave

0 commit comments

Comments
 (0)