-
Notifications
You must be signed in to change notification settings - Fork 4
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
faster area #36
faster area #36
Conversation
np -= first_last_equal ? 1 : 0 | ||
|
||
first = true | ||
local pfirst, p1 |
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.
What does local
do here? Just for my future knowledge?
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.
It makes the variables available in the scope outside thep loop
# Skip the first and do it later | ||
# This lets us work within one iteration over geom, | ||
# which means on C call when using points from external libraries. | ||
if first |
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 this is a pretty good way to do this.
Looks great! Dang, the LibGEOS performance is still painful! But excited about the improvements with native polygons! |
I got LibGEOS down to 3x faster than that with other changes... |
With all the fixes in LibGEOS this gets us to ~20x slower territory for #32
(and 2x faster than libgeos when working with native geoms!)
The idea with deleting all the handling of closed/open polygons is that the last point will contribute zero area anyway if its a repeat of the first one - so we can just ignore it.