-
Notifications
You must be signed in to change notification settings - Fork 273
Conversation
Really nice - thanks!
oh, what was the problem here? I do like gradle a bit more (see also an issue on GH core) but the work would be too big to make sense now.
That should be done already from the MiniPerfTest
Yes, this sounds good. I think I've done this in the tests already somewhere. |
I've just never had experience with Maven (or Java) before (I'm more python/JS/etc.) - so figuring out how to make it all work (including in Eclipse) took a bit of head-scratching. Thankfully, I could just copy from e.g. graphhopper-tools.
Ah, didn't realise that. From what I see, there's no randomness added - both in which points are chosen (it seems one GPXEntry is created per instruction point) and the GPXEntry aligns exactly with the route. As an aside, I was thinking about adding in some new tests which create a random route and create some GPX entries, and then check that the map-matched route is the same - what do you think? I will tidy this PR up now. For anyone else reading, some next steps (which I'll try to add as TODO's in the code):
|
I recommend to use NetBeans or IntelliJ instead (especially when you use maven). Eclipse is a no go for me personally ;)
For perf comparison you could make the parameters you want to change configurable instead. But for me it was often a lot easier to create a separate branch and test some config change here something there and commit these to the branch. The it doesn't matter where I ended up I could always type either
Uups - indeed. That is something we can/should do. I probably didn't added the randomness as the old algorithm was not good enough to figure out all situations.
Yes, sounds good. I would distort the routing output a bit before the map matching and compare the original route length R (not the length G calculated from gpx entries) with the map matched length M and allow only <1% difference or something. If one would compare G and M the difference could be bigger. |
I was more thinking of changes to the code base (which you want to test before you commit). I actually just slipped up after running the test as it left me in a detached head state, which I then committed to.
Submitted a new issue to remind us. |
Is it OK to do this on my fork, to update my user details for this PR, given it hasn't been merged. I'm not sure if that'll mess with anything else (including the PR you just merged ...) |
Yes, you should be able to change your user details here and push (force) without making a problem on my side here. |
Excellent, seems to have worked. Want me to merge in the new API, or leave that to you? |
} | ||
|
||
// TODO: do we need to return something non-trivial? | ||
return 0; |
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.
for all return values we need some results from the calculation to avoid JVM optimization kick in and remove the whole code above (although unlikely here IMO)
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.
Ah, didn't know that. Fixed, and also fixed a few other bugs with the test.
Sorry, will have a look to your latest changes - thanks! |
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. Will test it locally.
@@ -1,51 +1,98 @@ | |||
#!/bin/bash | |||
|
|||
# bail if any errors ... | |||
set -e |
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.
This strict option might be useful for graphhopper.sh too
git checkout "$commit" | ||
git log -n 1 --pretty=oneline >> "$fname" | ||
startMeasurement | ||
while read -r line; do |
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.
where does this loop through?
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.
This is my way of merging results across multiple commits into a single file. Outputs are written temporarily to $measurement_fname
(see line 43 and 57) and read in line by line (see line 78). Then 66-77 is logic for stripping the key and value from each line, and
- adding a new line if it's a new measurement key
- adding the value to the next column if it's an existing key
This is taken care of in the $values
file. My advice: try it and see = )
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.
My advice: try it and see = )
Will definitely do this... before: why would I want to have multiple results in one file? If I have one file per commit I know exactly what is what and can give a computer those files as input (already have an bit hidden UI here - wait a bit and then click e.g. routing
)
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.
See first PR comment - I find it much easier to compare performance across multiple commits when all the values are side-by-side, etc. The previous approach meant you had to open e.g. 10 files, and manually eyeball through until you found the right value, then memorise it and compare against all others, etc. If you wanted to compare across multiple metrics, it was even worse. Of course, if you're making a separate UI, there's not much need.
It's very easy to keep the original raw files per commit, if you're that way inclined (I just delete them, i.e. line 85).
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.
You convinced me to invest a bit time to make the UI working easily - wasn't easy to get it working locally but with nodejs this was rather simple:
Would you mind to make this working with this UI?
@karussell, is there anything I can do to move this along? I ask because I've anecdotally found odd results. E.g. one would expect deduping on node ID (see #81) to improve performance (by reducing the number of candidates), but I actually found it decreased it (in a specific case, and including when I'm caching the paths and using DIJKSTRA_ONE_TO_MANY). Similary, it'd be good to know how #83 affects performance, etc. |
Updated to address some of the above concerns, and add in a new feature. Specifically, running it for e.g. the last 5 commits will create five separate files (named
The (start) for the corresponding output (which is the same as the merged file):
In future (this PR?), we could/should
I guess it should work if you copy the files into the right place. (I'm assuming you don't want me to add a duplicate UI to the map-matching module? As and aside, that's another good reason for merging). As discussed here ... maybe we have something like this for the individual developer use case, and leave the UI as a separate thing for the full history browsing use case? |
PS - we can remove all the merging stuff and graphs, if you want. It's kind of a proof-of-concept, but it might be pointless, depending what happens with the GUI. |
Hmmh, you rely on gnuplot. I really like that you try for simple solutions, but this will definitely make problems on other OSes (and I say this although I love gnuplot and I have it always installed :) )
No. Duplication would be ugly. Maybe I'll keep it out of GH then completely
If we really want a separate thing here to get a fast overview directly after the run I would highly prefer a pure Java solution for the graphing/pictures and e.g. use jfreechart (which can be used to export images too). See e.g. the usage in the pt branch here |
Totally forgot: thanks for creating the separate measurement properties, also the merged measurement file is useful. Now we need to decide regarding the plotting, if optional, with pure Java or not at all in this for now. |
Kind of - it works without, and you get notified if you don't have it. If a developer wants graphs (they may not need then) and if they're like me (unix based and install things willy nilly) then it shouldn't be an issue. (It's also worth noting that the UI here relies on NPM etc.) However, this is more of a POC and I think (?) I could pretty easily write a bash-based solution, or we could use a different tool. (I've actually never used gnuplot before - I just chose it as it gives you ASCII charts.)
I agree. However, the only way I can see this working (which I think you're alluding to as well) is
Thanks = ) I enjoy weird little puzzles like this. |
NPM is something we already require for the web UI, also as you said we can load measurement files from disc directly or even reject the entire PR as not really helpful. What do you mean with 'etc'?
Would you still mind to remove it? Maybe you can create a separate script for your own usage? Keep in mind: everything thing we add needs to be maintained (somehow from someone) and for that reason I would try to reduce complexity - at least for now. (step by step appraoch :))
Probably that is the best. Still we need to figure out how to improve step by step, with a clear vision of the final goal (historic overview vs. developer trial and also regarding Java plotter). |
Just my shorthand way for expanding the way you did above.
No worries at all - it was more a test that anything else. All removed.
Good point - I don't think I've fully appreciated that.
Agreed. |
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'll merge this here now.
btw: afterwards I'll start to merge map matching repo with the core repo
Would you squash into as few commits as necessary for you (in your opinion)? |
Great - hope it isn't too painful!
I haven't done this before sorry, and on the merge button options it says that 'squash and merge' is not enabled for this repository? Any tips? |
You can do it either with your IDE or with the command line: I've explicitly disabled squashing here for merging to avoid problems like authorship lost etc |
Ah and afterwards you will have e.g. just one commit different on your branch issue_68, then do a If that is too much for the beginning I can do it :) |
Yes please! It looked simple enough, except I've also got merges in there, and for now I'd appreciate if you dealt with those, if it makes sense. (If it were a private repo, I might play, but I don't want to muck this up for others.) I'm happy for you to squash it all into a single commit (if possible). Thanks! |
Ah, yes. Then I do it via a workaround which I found somewhere:
Now the merge is reverted but all changes are still in the working tree and we can commit all changes on master or if on the other branch then do:
|
Ok, decided to go the simple way to enable squashed merges temporary ... I hope this was okay? |
Doesn't worry me - looks like I'm still down as contributing. Thanks @karussell. |
As discussed in #67 and #68. Code isn't ready for a full merge - I'm looking for some initial feedback on the general approach. Key points:
matching-tools
module (likegraphhopper-tools
)Measurement.java
from GH, and added two tests: one for location lookups (i.e.findNClosest
) and one for testing a bunch of randomly created GPX entries (randomly pick start/end, then find route, then down-sample points).Todo:
Example usage: