Comments (13)
Great. I'll try to get a PR with Rcpp
-ed lines2routes
as soon as I can ...
from stplanr.
Wow - this will greatly improve performance. @mpadge will benchmark your new work and hope to see at least a halving of run-time on typical beefy applications ;)
As a general point, where's a good place to put benchmarks?
I note that in sfr the demo folder is used - sound like a plan?
E.g.: https://github.com/edzer/sfr/blob/6f2d6a64d6caf4eb159d9f808c0b16a47759fab5/demo/bm_wkb.R
from stplanr.
Nup, look about 2/3 of the way through this bit of the R extensions manual. The demo
folder serves to demo the utility of the package. (And i think edzer is interpreting that a bit too flexibly with sf
.) The highly structured nature of R extensions doesn't really allow for benchmarks, which I'd suggest leaves recourse only to git-specific places which in turn (short of junking up the .Rbuildignore
) leaves just the wiki, as I've done for osmdata
benchmarks.
from stplanr.
Hmm OK - really if R wants to be an efficient language I think package authors should be given a recommended 'home' for their benchmarks, which I guess should only build on local builds (e.g. when building the public facing README or vignettes).
In absence of any inspiration from above I politely tag experienced R package authors @hadley and @csgillespie for guidance on this question: where to put benchmarks in packages?
I've also asked this as a question to the world here as I imagine the answer will be of use/interest to others: http://stackoverflow.com/questions/40976077/where-should-package-authors-place-benchmarks
from stplanr.
To be honest, I think where you store the code is of secondary importance to where you store the results, since you really want to be running the benchmarks on every push, and storing the results in such a way that you can identify performance regressions. This is crying out for an external service like for code coverage.
I think tests/benchmarks
would be a reasonable place for the code to live.
from stplanr.
Thanks for the fast reply.
Agree re automated storage of the results with each push to identify regressions.
The next stage is to find out how to do this - my understanding is that it can be done with something like codecov.io and reported on a page like this one: https://codecov.io/github/hadley/dplyr?branch=master
But I'm not sure precisely how...
Really useful and agree tests/benchmarks
sounds like an entirely reasonable long-term home for these important benchmarking tests.
from stplanr.
Also - here's my source of information of code coverage in R - having speed read it I'm still not 100% sure how it works but imagine others will figure it out in double time: https://github.com/jimhester/covr/blob/master/vignettes/how_it_works.Rmd
from stplanr.
Code coverage only stores what lines of code were covered, not how long it took.
from stplanr.
Ah OK. Suggest storing the results in tests/benchmarks
and calling those from the README.Rmd to print them for all to see as the default option, unless someone has a better suggestion.
from stplanr.
... sorry, i should have looked a bit deeper before opening my mouth / typing hands on that one. The loops mentioned in #151 can't be usefully benchmarked because they're API calls. These are thus quite non-ideal candidates for Rcpp
-ification. In the absence of any better or preferred suggestions, I could maybe start on od_radiation
?
from stplanr.
od_radiation does seem like a good candidate to start off with. I still think that some of the loops mentioned in #151 could be reasonably ported to Rcpp by restructuring them so that constructing the SpatialLines is done after all the calls have been made, rather than immediately after each call. Probably still best to start off with more straightforward functions.
from stplanr.
What's you view on this @richardellison ? Happy to close if it's gone stale.
from stplanr.
Nudge @richardellison - suggest we close for now.
from stplanr.
Related Issues (20)
- Comparing the results between angle_diff with calculate_angle/get_vector HOT 1
- Error message in bind_sf
- CRAN issues
- bug in the rnet_merge function when defining the funs HOT 3
- Use different buffer options in `rnet_merge()`
- Convert large GeoJSON file to PMTiles HOT 1
- bug in geo_buffer HOT 7
- Possible speed enhancement to `mats2line()` HOT 3
- Invalid LineStrings in routes_fast_sf HOT 1
- Use `od::odc_to_sfc()` do the legwork in `mats2line()` HOT 3
- Bug in `line_segment()` when using certain values on projected data with `rsgeo` implementation HOT 8
- `rnet_merge()` fails when inputs are projected HOT 4
- `line_bearing()` is slow HOT 3
- Argument of segment_length in line_segment fun causes issue HOT 14
- Tried creating a route from desirelines using osrm function HOT 9
- rnet merge function can't not handle attributes containing strings HOT 1
- Add links to more papers in DESCRIPTION
- Re-add n_segments argument to line_segment() HOT 1
- `line_segment()` fails when n_segments has multiple values HOT 1
- od2line() throws an error if only one origin-destination relation is selected HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stplanr.