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

Support more types for normals #719

Merged
merged 1 commit into from Aug 5, 2016

Conversation

Projects
None yet
2 participants
@patricksnape
Contributor

patricksnape commented Jul 29, 2016

This involved removing numpy specific typing from the Cython
and thus making the code more 'c'-like. However, this had an
advantage of making the code faster. While I was here I also
seperated the vertex and face calculation to make face normal
calculation from Python twice as fast.

This fixes #718.

The speedup is as follows:

OLD
100 loops, best of 3: 10.2 ms per loop
100 loops, best of 3: 9.53 ms per loop
NEW
100 loops, best of 3: 8.28 ms per loop
100 loops, best of 3: 4.93 ms per loop

@patricksnape patricksnape force-pushed the patricksnape:normal_types branch from 60c82f6 to aff664a Aug 1, 2016

@patricksnape

This comment has been minimized.

Contributor

patricksnape commented Aug 1, 2016

We can make this a little bit faster by turning off bounds checking - though at the risk of a segfault if the triangulation is bad.

Support more types for normals
This involved removing numpy specific typing from the Cython
and thus making the code more 'c'-like. However, this had an
advantage of making the code faster. While I was here I also
seperated the vertex and face calculation to make face normal
calculation from Python twice as fast.

@patricksnape patricksnape force-pushed the patricksnape:normal_types branch from aff664a to 99250a9 Aug 5, 2016

@patricksnape

This comment has been minimized.

Contributor

patricksnape commented Aug 5, 2016

@jabooth Please review.

@jabooth

This comment has been minimized.

Member

jabooth commented Aug 5, 2016

Looks good to me, thanks! +1.

@jabooth jabooth merged commit 6ca3151 into menpo:master Aug 5, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
macOS MenpoBot Jenkins build passed
Details

@jabooth jabooth removed the in progress label Aug 5, 2016

@patricksnape patricksnape deleted the patricksnape:normal_types branch Aug 5, 2016

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