-
Notifications
You must be signed in to change notification settings - Fork 124
MeshAlgo::MeshSplitter : Preserve vertex order #1441
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
MeshAlgo::MeshSplitter : Preserve vertex order #1441
Conversation
763e90e to
f8e4049
Compare
|
Reverted the segment() tests to their previous hardcoded values, so those should be passing now. Here are the performance numbers if I run the full, slow, perf tests: BEFORE: AFTER: Basically, the smaller tests are pretty well equivalent, some of the big tests get 50% slower. Probably an acceptable tradeoff? |
johnhaddon
left a comment
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.
Thanks Daniel! The requirement to call computeIndices() manually in some cases but not others does feel a bit odd - if we can make computeIndices() private and fully automatic without too much cost then I think that would be worthwhile. I made a couple of comments inline about that...
src/IECoreScene/MeshAlgoSplit.cpp
Outdated
|
|
||
| // Don't add the index, but just test if it is a part of the reindex. If it is an | ||
| // id which has already been added, return the new id, otherwise return -1 | ||
| // You must call computeIndices() after calling addIndex and before calling this function. |
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.
Why is this the only public method that puts the onus on the caller to call computeIndices()? If this also called computeIndices() for you, then it seems computeIndices() could be private and the Reindexer API wouldn't have changed at all.
I'm assuming it's related to performance, but I can't see anywhere where addIndex() and testIndex() are interleaved in a way that would cause repeated computeIndices() calls. Maybe I missed something? If it is performance, then perhaps it could be alleviated by only calling computeIndices() when we find we're about to return an ID that hasn't been computed yet?
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.
Perhaps it's not about performance, but just that addIndex() doesn't reset m_indicesComputed back to false?
|
Oh, and Changes needs updating, and the PR needs to target |
f8e4049 to
a5885ef
Compare
|
My instincts didn't like calling computeIndices in an inner loop, when our usage of this private class never requires it, but there's no measurable loss of performance from it, so I've cleaned up the API. Also rebased and added Changes entry. |
|
Merged. Thanks Daniel! |
Reverted recent update since ImageEngine#1441 made it unnecessary.
I feel like maybe I should have explained a bit more about the now-somewhat-odd interface to Reindexer, but maybe it doesn't matter since it's fully internal.
Maybe take a look and see if this makes sense to you?