Draft
Conversation
Comment on lines
+950
to
+957
| let extra = if let Some(x) = original.context.get_last_error() { | ||
| format!("\nLast error: {x}") | ||
| } else { | ||
| String::new() | ||
| }; | ||
| return Err(Error::NoConstructionFromNullPtr(format!( | ||
| "CoordSeq::{caller}{extra}", | ||
| ))); |
Member
There was a problem hiding this comment.
You're calling two format! here, which isn't great. Could you instead have format!s directly into the let Some(x) else please?
Member
|
I don't see anything bad in particular in the implementation. So the relevant question here would be: are you sure this clone was this expensive for you? Do you have a flamegraph comparison between before and after? |
Member
Author
No I'm not 😄 it was an (uneducated?) guess. I need to learn how to better profile rust code 😅 |
Member
|
Well in any case, this PR seems to be on good track so if you fix the errors, I'll gladly merge it. Take a look at how the other |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #137
This adds a new struct for
ConstCoordSeqthat contains a const pointer to the GEOS coord seq object.The ideal API would probably be to have something like the
Geomtrait for coordinate sequences, but I assume that's backwards-incompatible, because users would then also have to import such a trait?I didn't notice any performance improvement on my relevant benchmark in my geoarrow project, so it's possible I either implemented it wrong or this is such a small performance gain that it's immeasurably small.