vector-benchmark icon indicating copy to clipboard operation
vector-benchmark copied to clipboard

More complex benchmarks

Open martinfleis opened this issue 1 year ago • 9 comments

Hey @kadyb,

would you be up for expanding the benchmarks with more complex tasks? I have a felling that those you have in here now, especially for buffer and distance, can be a bit misleading. Since both of them are based on points only, some libraries (terra, sf) have a special fast-path for them. I would be interested in more complex options, like distance between polygons and buffering of polygons. Right now, these tests sort of only check if the library has a fast-path implemented for these or not.

martinfleis avatar Apr 14 '24 12:04 martinfleis

Sure! I will try to add the tasks you suggested. If you have more ideas for tasks, let me know.

kadyb avatar Apr 14 '24 13:04 kadyb

Maybe some binary constructive method like intersection or difference. We have unary constructive (buffer) and predicate only.

Maybe WKT parsing? Or unary union may be also interesting. That tends to be expensive.

martinfleis avatar Apr 14 '24 15:04 martinfleis

This is an example of what I was talking about regarding the fast-path distance algo - https://github.com/shapely/shapely/issues/2038

martinfleis avatar Apr 15 '24 08:04 martinfleis

Maybe we should report this in the GEOS repository? sf uses a base function from R, i.e. dist(), but this is not the fastest way. Even better results are provided by the Rfast::Dist(), which is written in C++.

kadyb avatar Apr 15 '24 08:04 kadyb

Maybe we should report this in the GEOS repository?

Yeah, @theroggy suggested the same in the shapely issue. Will do.

sf uses a base function from R, i.e. dist(), but this is not the fastest way

I don't think so, see https://github.com/r-spatial/sf/blob/32aa6c8c53005245493540b1359bc35fe50f0115/R/geom-measures.R#L200-L203 But I know little about the performance of R world.

martinfleis avatar Apr 15 '24 08:04 martinfleis

by_element is FALSE, so this path: https://github.com/r-spatial/sf/blob/32aa6c8c53005245493540b1359bc35fe50f0115/R/geom-measures.R#L207-L208

kadyb avatar Apr 15 '24 08:04 kadyb

Ah, okay. You see I know nothing about R :D.

The GEOS issue - https://github.com/libgeos/geos/issues/1066

martinfleis avatar Apr 15 '24 08:04 martinfleis

After the workshop in Prague, you will be specialist in R and Julia 😄

kadyb avatar Apr 15 '24 08:04 kadyb

They won't be directly usable, but you can get some inspiration for some possible benchmarks for more complex spatial operations here: https://github.com/geofileops/geobenchmark/blob/main/results_vector_ops/GeoBenchmark.png

theroggy avatar Apr 16 '24 11:04 theroggy