-
Notifications
You must be signed in to change notification settings - Fork 42
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
WIP ConstCoordSeq #138
base: master
Are you sure you want to change the base?
WIP ConstCoordSeq #138
Conversation
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}", | ||
))); |
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're calling two format!
here, which isn't great. Could you instead have format!
s directly into the let Some(x) else
please?
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? |
No I'm not 😄 it was an (uneducated?) guess. I need to learn how to better profile rust code 😅 |
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 |
Closes #137
This adds a new struct for
ConstCoordSeq
that contains a const pointer to the GEOS coord seq object.The ideal API would probably be to have something like the
Geom
trait 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.