-
Notifications
You must be signed in to change notification settings - Fork 206
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
PrimitiveAlgo : Optimize transformPrimitive #6037
Conversation
Oh, and some performance numbers: this is embarrassingly parallel, there's an 8X speedup in the test turning on threading. The other two fixes are minor, around 10% each after threading. |
@johnhaddon I wasn't sure what would go wrong if I just tried to switch FreezeTransform to inherit from ObjectProcessor, so I just tried it. Everything went pretty smoothly ... except that it doesn't actually work because FreezeTransform needs to process any objects that have ancestor matches, whereas ObjectProcessor is hardcoded to affect only objects with exact matches. Do you think it could be reasonable to allow customizing that on ObjectProcessor? Or perhaps I could just make an intermediate filter plug on FreezeTransform that returns ExactMatch whenever there's an AncestorMatch? |
Ah, of course. Sorry, I should have anticipated that.
What would that look like? Some sort
I'm not sure that can be made to work without modifying ObjectProcessor, since it would need to know to look at the intermediate filter and not the main one (and we can't connect something to the main one, because that is user-facing). Looking at ObjectProcessor, there is so little involved in managing the |
Copied in the implementation of the __processedObject plug. A bit of a hasty copy/paste job, but everything seems to be working OK. |
Thanks Daniel. Could you rebase this on the latest |
7eb996f
to
b19d68d
Compare
Removed hashProcessedObject/computeProcessedObject - I just thought the consistency might be nice for someone comparing to other nodes, but considering this code in isolation, it's definitely nicer this way. Squashed it and added changelog, should be ready for merge. |
b19d68d
to
fb12ba0
Compare
Rebased to fix merge conflict, added a Changes.md entry to mention cancellation support, and merged. |
Applies on top of #6026.
This optimizes 3 things: added threading, moving the check for interpretation out of the inner loop, and moving the canceller out of the inner loop. In theory, we only needed to delay the threading fix out of the previous PR, but the other two require splitting into subranges anyway, so it's easiest to keep them together.