Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize extract nodes algorithm #5612

Merged
merged 3 commits into from Nov 13, 2017
Merged

Conversation

nirvn
Copy link
Contributor

@nirvn nirvn commented Nov 13, 2017

Description

This PR optimizes the extract nodes algorithm by upgrading it to native C++. I've also added a couple of tags to the algorithm to ease its discoverability (let's not throw people into SAGA for such a simple task 馃槈)

@nyalldawson , your review would be appreciated.

Checklist

Reviewing is a process done by project maintainers, mostly on a volunteer basis. We try to keep the overhead as small as possible and appreciate if you help us to do so by completing the following items. Feel free to ask in a comment if you have troubles with any of them.

  • Commit messages are descriptive and explain the rationale for changes
  • Commits which fix bugs include fixes #11111 in the commit message next to the description
  • Commits which add new features are tagged with [FEATURE] in the commit message
  • Commits which change the UI or existing user workflows are tagged with [needs-docs] in the commit message and containt sufficient information in the commit message to be documented
  • I have read the QGIS Coding Standards and this PR complies with them
  • This PR passes all existing unit tests (test results will be reported by travis-ci after opening this PR)
  • New unit tests have been added for core changes
  • I have run the scripts/prepare-commit.sh script before each commit

@nyalldawson
Copy link
Collaborator

Looks good!

@nirvn
Copy link
Contributor Author

nirvn commented Nov 13, 2017

Nice speed gain: 20.89sec (python) vs 15.36sec (native c++) for a large-ish polygon dataset resulting in 51,000 points.

@nirvn
Copy link
Contributor Author

nirvn commented Nov 13, 2017

@nyalldawson , as suggested, I'm now using a vertex iterator. For the record, it didn't lead to great speed gains. The same dataset now takes 15.13sec, virtually no gain here.

@nirvn nirvn force-pushed the native_nodes branch 2 times, most recently from 7fb2ef9 to b0d99d5 Compare November 13, 2017 09:37
@nirvn
Copy link
Contributor Author

nirvn commented Nov 13, 2017

@m-kuhn , any idea why the tests fail with precision?

@nyalldawson nyalldawson reopened this Nov 13, 2017
@nyalldawson
Copy link
Collaborator

any idea why the tests fail with precision?

Fixed - using precision wasn't working if a NULL value was present in an attribute

@nyalldawson nyalldawson merged commit 3c8d50d into qgis:master Nov 13, 2017
@nyalldawson
Copy link
Collaborator

@nirvn

Nice speed gain: 20.89sec (python) vs 15.36sec (native c++) for a large-ish polygon dataset resulting in 51,000 points.

I take your paltry 25% speed gain and raise you a 98% speed gain: #5621 ;)

@nirvn
Copy link
Contributor Author

nirvn commented Nov 14, 2017

@nyalldawson , I am once again humbled 馃槈

@nirvn nirvn deleted the native_nodes branch February 26, 2018 12:39
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.

None yet

2 participants