Skip to content

Commit 7b3bf03

Browse files
committed
Bump Version
1 parent ebeb96a commit 7b3bf03

File tree

8 files changed

+101
-11
lines changed

8 files changed

+101
-11
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## [0.6.5] - 2025-10-30
4+
- Few small optimization in the tree build phase (5%)
5+
36
## [0.6.4] - 2025-10-29
47
- Multiple optimizations for query_intersecting() (43%)
58

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22

33
name = "aabb"
4-
version = "0.6.4"
4+
version = "0.6.5"
55
description = "Static AABB spatial index for 2D queries"
66
rust-version = "1.88"
77
edition = "2024"
@@ -22,7 +22,7 @@ codegen-units = 1
2222
panic = "abort"
2323
opt-level = 3
2424
# for samply
25-
debug = 1
25+
#debug = 1
2626

2727
[dev-dependencies]
2828
rand = "0.9"

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ Environment:
117117
> cargo bench --bench query_intersecting_bench_i32
118118
119119
Building index with 1000000 items...
120-
Index built in 116.58ms (f64)
121-
Index built in 85.22ms (i32)
120+
Index built in 89.28ms (f64)
121+
Index built in 63.64ms (i32)
122122
123123
Running query benchmarks:
124124
-----------------------
@@ -131,17 +131,17 @@ HilbertRTree::query_intersecting(f64)
131131
132132
-----------------------
133133
HilbertRTreeI32::query_intersecting(i32)
134-
1000 searches 100%: 1389ms
135-
1000 searches 50%: 204ms
136-
1000 searches 10%: 47ms
137-
1000 searches 1%: 7ms
138-
1000 searches 0.01%: 2ms
134+
1000 searches 100%: 1397ms
135+
1000 searches 50%: 197ms
136+
1000 searches 10%: 42ms
137+
1000 searches 1%: 6ms
138+
1000 searches 0.01%: 0ms
139139
140140
Running neighbor benchmarks:
141141
-----------------------
142142
query_nearest_k(f64)
143143
1000 searches of 100 neighbors: 13ms
144-
1 searches of 1000000 neighbors: 111ms
144+
1 searches of 1000000 neighbors: 107ms
145145
100000 searches of 1 neighbors: 556ms
146146
147147
```

benches/profile_bench.rs

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,5 +338,63 @@ Summary:
338338
--------
339339
Build dominates: 25.1%
340340
Queries (total): 352.22ms
341+
_________________________________________________________________________________
342+
Opt 7 - use rust sorting instead of custom quicksort
343+
344+
Generating 1000000 random boxes...
345+
Generated in 30.14ms
346+
347+
Building index...
348+
Add items: 11.30ms
349+
Build tree: 84.25ms
350+
Total build: 95.57ms
351+
352+
Profiling query_intersecting:
353+
----------------------------------------
354+
1000 small queries (1%): 4.35ms (4.349µs/query)
355+
1000 large queries (10%): 352.46ms (352.463µs/query)
356+
357+
Profiling query_nearest_k:
358+
----------------------------------------
359+
1000 queries k=1: 5.81ms (5.811µs/query, avg 1.0 results)
360+
1000 queries k=10: 5.99ms (5.990µs/query, avg 10.0 results)
361+
1000 queries k=100: 12.94ms (12.944µs/query, avg 100.0 results)
362+
100 queries k=1000: 7.94ms (79.404µs/query, avg 1000.0 results)
363+
364+
Profiling query_point:
365+
----------------------------------------
366+
10000 queries: 9.75ms (0.975µs/query, avg 24.0 results)
367+
368+
Profiling query_intersecting_k:
369+
----------------------------------------
370+
10000 queries k=100 (small): 16.71ms (1.671µs/query, avg 100.0 results)
371+
372+
Profiling query_contain:
373+
----------------------------------------
374+
1000 queries (point-like): 1.65ms (1.645µs/query, avg 21.0 results)
375+
376+
Profiling query_contained_within:
377+
----------------------------------------
378+
1000 queries (small): 2.35ms (2.354µs/query, avg 28.0 results)
379+
380+
Profiling query_circle:
381+
----------------------------------------
382+
1000 queries (radius=5): 46.70ms (46.697µs/query, avg 8830.0 results)
383+
384+
Profiling query_in_direction:
385+
----------------------------------------
386+
1000 queries (small): 11.95ms (11.950µs/query, avg 1752.0 results)
387+
388+
Profiling query_in_direction_k:
389+
----------------------------------------
390+
1000 queries k=50 (small): 19.75ms (19.746µs/query, avg 50.0 results)
391+
392+
==================================================
393+
394+
Summary:
395+
--------
396+
Build dominates: 21.1%
397+
Queries (total): 356.81ms
398+
341399
342400
*/

benches/profile_parallel.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,23 @@ Profiling query_nearest_k (parallel):
235235
10000 queries k=10 (parallel 10×1000): 12.03ms (1.203µs/query)
236236
10000 queries k=100 (parallel 10×1000): 24.27ms (2.427µs/query)
237237
1000 queries k=1000 (parallel 10×100): 14.85ms (14.848µs/query)
238+
________________________________________________________________________
239+
OPT 7 - using rust sort instead of custom quicksort
240+
Building index...
241+
Index built in 89.97ms
242+
243+
Profiling query_intersecting (parallel):
244+
----------------------------------------
245+
10000 small queries (parallel 10×1000): 6.54ms (0.654µs/query)
246+
10000 large queries (parallel 10×1000): 701.32ms (70.132µs/query)
238247
248+
Profiling query_nearest_k (parallel):
249+
----------------------------------------
250+
10000 queries k=1 (parallel 10×1000): 10.39ms (1.039µs/query)
251+
10000 queries k=10 (parallel 10×1000): 11.19ms (1.119µs/query)
252+
10000 queries k=100 (parallel 10×1000): 22.95ms (2.295µs/query)
253+
1000 queries k=1000 (parallel 10×100): 14.07ms (14.069µs/query)
254+
_________________________________________________________________________
239255
240256
241257

examples/perf.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ fn main() {
8888

8989

9090
/*
91+
cargo build --release --example perf
92+
./target/release/examples/perf
93+
samply record cargo run --release --example perf
94+
9195
Building large spatial index...
9296
Index built in 97.08ms
9397
Index size: 1000000 items

examples/perf_i32.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ fn main() {
7474

7575

7676
/*
77+
cargo build --release --example perf_i32
78+
./target/release/examples/perf_i32
79+
7780
Base
7881
Completed 100,000 queries in 11622.38ms (116.22µs per query)
7982
@@ -100,6 +103,12 @@ Profile Summary (i32 variant):
100103
Querying: 6389.59ms
101104
Total: 6486.86ms
102105
______________________________________________________________
106+
Opt 7 - use rust sort methods instead of custom variant of quicksort
103107
108+
Profile Summary (i32 variant):
109+
Building: 70.44ms
110+
Querying: 6082.92ms
111+
Total: 6153.36ms
112+
______________________________________________________________
104113
105114
*/

0 commit comments

Comments
 (0)