Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potentially faster strtree implementations #73

Merged
merged 13 commits into from
Aug 13, 2022
Merged

Potentially faster strtree implementations #73

merged 13 commits into from
Aug 13, 2022

Conversation

paleolimbot
Copy link
Owner

Fixes #66 (hopefully!).

@codecov-commenter
Copy link

codecov-commenter commented Aug 5, 2022

Codecov Report

Merging #73 (5d325a2) into master (956a675) will decrease coverage by 0.28%.
The diff coverage is 93.04%.

@@            Coverage Diff             @@
##           master      #73      +/-   ##
==========================================
- Coverage   97.54%   97.26%   -0.29%     
==========================================
  Files          31       33       +2     
  Lines        2809     2996     +187     
==========================================
+ Hits         2740     2914     +174     
- Misses         69       82      +13     
Impacted Files Coverage Δ
src/init.c 100.00% <ø> (ø)
src/geos-basic-strtree.c 91.60% <91.60%> (ø)
R/geos-basic-strtree.R 97.72% <97.72%> (ø)
R/geos-make.R 100.00% <0.00%> (ø)
R/geos-unnest.R 100.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@paleolimbot
Copy link
Owner Author

Example:

library(geos)

many_points <- wk::xy(runif(1e6), runif(1e6))

geos_match_xy <- function(x, table) {
  tree <- geos_basic_strtree()
  geos_basic_strtree_insert(tree, x)
  geos_basic_strtree_query(tree, x, limit = 1, fill = TRUE)
}

bench::mark(
  geos_match_xy(many_points, many_points),
  iterations = 5,
  check = FALSE
)
#> # A tibble: 1 × 6
#>   expression                                   min   median `itr/sec` mem_alloc
#>   <bch:expr>                              <bch:tm> <bch:tm>     <dbl> <bch:byt>
#> 1 geos_match_xy(many_points, many_points)    1.02s    1.02s     0.980     7.7MB
#> # … with 1 more variable: `gc/sec` <dbl>

Created on 2022-08-11 by the reprex package (v2.0.1)

@paleolimbot paleolimbot merged commit a25b6b1 into master Aug 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

st_intersect faster than geos_intersects_matrix()
2 participants