-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
… line-strings, thanks to michaelkirk Unfortunately this increases the parsing time from 11s to 26s
- Loading branch information
There are no files selected for viewing
6 comments
on commit 59a7007
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, 👍 to simpler code that's easier to maintain and contribute to. Is this related to the fact that input could contain Linestring, MultiLinestring, or other geometry types? Have hit issues around different geom types as inputs in the R/GEOS implemenation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And many thanks @michaelkirk for contributing to active travel stuff from afar!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately this increases the parsing time from 11s to 26s
@dabreegster - I'm attempting some perf work over in georust/geojson#222
Do you have a benchmark or an example command invocation I could run to see this difference? All the geojsons committed in the repository seem pretty small.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michaelkirk, https://github.com/actenglabs/overline/releases/download/v0/cycle_routes_london.zip
cargo run --release cycle_routes_london.geojson
should do the trick. Reading + deserializing takes 16s on https://github.com/actenglabs/overline/tree/rust for me. On https://github.com/actenglabs/overline/tree/rust_variation, up to 34s
Thank you for making base dependencies even more awesome!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: Improvements are somewhere between modest and non-existent using georust/geojson#222
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm making a little progress over at (draft) PR georust/geojson#223
With branch rust
:
Reading and deserializing ../cycle_routes_london.geojson
... took 7.46851125s
Running overline on 125317 line-strings
... took 3.667612875s
Writing with indices to output.geojson
... took 333.463458ms
With branch rust_variation, which introduces a nicer API and the option of streaming to minimize memory usage.
Reading and deserializing ../cycle_routes_london.geojson
... took 18.82973175s
Running overline on 125317 line-strings
... took 3.42870325s
With georust/geojson#223, which avoids (heap) allocating a Vec per coordinate:
Reading and deserializing ../cycle_routes_london.geojson
... took 6.830074834s
Running overline on 125317 line-strings
... took 3.173955875s
The branch is in a pretty rough and incomplete state, but it seems doable.
FYI there is serialize support for custom structs too if you wanted to try to apply similar changes to this code.