-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ValuePlug : Fix
getValue()
performance regression
Commit 055f07d moved the `computeNode` assignment before the fast path for plugs with static values. This caused significant slowdown when the node was implemented in Python, due to the overhead of the `runTimeCast()`. The excessive Python-specific overhead from this was fixed in the preceding commit, but the additional fix here still yields a 6% improvement in `testStaticNumericValuePerformance()` for the remaining C++-only case. This improvement will become even more significant soon, because I'm sitting on another optimisation which removes the majority of the remaining overhead for this case (the reference counting). The assignment to `computeNode` within the `if` might be a bit subtle for the reader, but I tried various other ways of factoring it, and they all resulted in at least one more conditional block and some duplicated code. I think this is the clearest way of writing it, particularly with the new assertion that shows the intended result.
- Loading branch information
1 parent
11b7361
commit f9100a6
Showing
3 changed files
with
32 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters