-
Notifications
You must be signed in to change notification settings - Fork 344
S2ClosestEdgeQueryBase::InitCovering: Use a single iterator #494
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
base: master
Are you sure you want to change the base?
Conversation
S2ClosestEdgeQueryBase…estEdgeQueryBase`
cc4416a to
6616076
Compare
|
Due to the complexity of this and the Go version, it'd help to have the feedback about whether or not anyone has thoughts on how to improve it, or if the TODO from the current code should just be removed from both Go and C++ otherwise. I'm happy to take another look but I can't keep this in mind forever and would need to move onto other things if there's no bandwidth to consider the changes. |
If it's going to be a problem for you to come back to the code in a few days or weeks, then it's definitely going to be a problem for someone else to look at it in a few years. Can you make sure the code is sufficiently documented so you don't need to "keep it in mind"? I will release the benchmarks soon, so you can test whether this makes a difference. Funny that it's so much more complex in go than C++. What's that? |
To clarify, I can't guarantee I won't be blocked by future events.
Go's patterns are different, but the C++ may not be totally correct as mentioned since I don't work with it often. (hence the "draft" PR and RFC) |
| // Don't need to reserve index_cells_ since it is an InlinedVector. | ||
| index_covering_.reserve(6); | ||
|
|
||
| // TODO(ericv): Use a single iterator (iter_) below and save position |
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.
S2ClosestEdgeQueryBase has an iter_ member, which is probably what this TODO is referring to:
s2geometry/src/s2/s2closest_edge_query_base.h
Line 452 in fd727eb
| S2ShapeIndex::Iterator iter_; |
|
There are many benchmarks in s2geometry/src/s2/s2closest_edge_query_test.cc Line 1001 in f79c017
Do we have coverage for this function and does PR speed them up? |
This is sibling to: golang/geo#248
While resolving a bug with the code sync between Go/C++ (golang/geo#247) I noticed the TODO.
Since there's seemingly an effort to mirror implementations, I'm opening a draft PR, because I barely work with C++ and I'd need someone to take a look at this.