Skip to content

Conversation

@benguild
Copy link
Contributor

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.

@benguild benguild changed the title Resolving iterator TODO (alongside Go) in "initCovering()" of S2ClosestEdgeQueryBase S2ClosestEdgeQueryBase::initCovering: Use a single iterator Dec 14, 2025
@jmr
Copy link
Member

jmr commented Dec 14, 2025

@ericveach

@benguild benguild force-pushed the closestEdgeQueryTODO branch from cc4416a to 6616076 Compare December 14, 2025 10:27
@jmr jmr changed the title S2ClosestEdgeQueryBase::initCovering: Use a single iterator S2ClosestEdgeQueryBase::InitCovering: Use a single iterator Dec 14, 2025
@benguild
Copy link
Contributor Author

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.

@jmr
Copy link
Member

jmr commented Dec 18, 2025

but I can't keep this in mind forever

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?

@benguild
Copy link
Contributor Author

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"?

To clarify, I can't guarantee I won't be blocked by future events.

Funny that it's so much more complex in go than C++. What's that?

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants