-
Notifications
You must be signed in to change notification settings - Fork 10
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
Make value type generic and independent from coordinate type #14
base: master
Are you sure you want to change the base?
Conversation
The |
f93227c
to
96465c5
Compare
Thanks for your PR and sorry it took me a while to reply. Indeed, making value type generic and independent from coordinate type is a great thing 👍
If this is the only way to keep the geojson feature working, we might as well take advantage of the breaking changes this PR is already making to make this one too, what do you thing ?
I don't have any particular problems with |
Hi @netthier! |
I'll do so then. Who knows what kind of numbers people might put in there, maybe some can indeed fail serialization.
I prefer I'll try to finalize this PR tommorow, but I'm still unsure about the part of the code I commented on in |
I don't really know either but let's say "better safe than sorry".
Let's go with
This seems like a good idea to me, with a new error type to be explicit about the reason for the error if it occurs (and since the smooth_linear caller already returns a Result it won't change the API for the user). |
0a062c2
to
f645f2c
Compare
This could use some tests tbh, but I'm not sure if I have the time and knowledge required to write good ones, let me know how you want to proceed there 🤔 |
744fee0
to
46483ea
Compare
I'm also unsure how my changes to |
Thanks!
I don't really have an idea of how to make meaningful tests for all this yet, but I'm thinking about it a bit.
I'm going to set up some benchmarks over the weekend to try to measure the difference in performance between 0.13.0 and your PR, and review your PR in the process. |
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.
Thanks for all the changes!
I did some performance testing: extending the lib's current benchmarks to test with larger datasets, in f64 and f32; and on real use cases.
There does seem to be a slight slowdown (sometimes around 5% extra time) but the variability of timings between runs (both on benchmarks with test::Bencher
and used elsewhere in an application) don't seem to allow me to conclude that this slowdown is a problem.
Have you had a chance to test performance on real data sets on your side?
I'm rather inclined to merge it; I think the flexibility that PR provides with regard to the type of input data is a good thing 👍
b479461
to
aa21a5f
Compare
I guess a slowdown would be expected with a lot of more handling of results now. I'm also seeing differences when running EDIT: Unwrapping and not propagating results at all isn't much faster, I wonder where all that overhead is coming from |
Signed-off-by: netthier <[email protected]>
Signed-off-by: netthier <[email protected]>
I'll have to profile this, I'm a bit surprised that even the |
Indeed, there's no rush to merge this, let's investigate a little bit the overhead it adds first.
Great if you get the chance to do this! |
This PR adds a new trait called
ContourValue
(though I'm not too happy with that name and would love better suggestions), which is defined asAll method signatures that took some type of values before are now rewritten to something such as
This allows for substantial memory and performance improvements in cases where the additional precision is not needed.
The PR is currently missing tests however, and it includes the changes from #13, meaning that should be merged first.