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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ColorPlugValueWidget : Lazy ColorShooser create #6063

Merged

Conversation

ericmehl
Copy link
Collaborator

This improves the performance of creating a ColorPlugValueWidget by deferring the creation of the internal color chooser to when it is first made visible.

For a single ColorPlugValueWidget, the difference is not all that noticeable, but for a node such as aiStandardSurface, the improved creation time of all the widgets in the node editor is subtly faster.

It's also noticeably faster when testing on top of #6003 where we are adding a number of additional widgets and increasing the amount of time needed to populate the node editor when not deferring color chooser creation.

For me, some timings when selecting an aiStandardSurface node :

  • Current code : 0.60 seconds
  • Deferred creation : 0.35 seconds (41% shorter)
  • New ColorChooser without deferred creation : 0.75 seconds (26% longer than current)
  • New ColorChooser with deferred creation : 0.35 seconds (53% shorter than without deferred)

Checklist

  • I have read the contribution guidelines.
  • I have updated the documentation, if applicable.
  • I have tested my change(s) in the test suite, and added new test cases where necessary.
  • My code follows the Gaffer project's prevailing coding style and conventions.

@johnhaddon johnhaddon mentioned this pull request Oct 1, 2024
4 tasks
@johnhaddon
Copy link
Member

Nice one! Thanks Eric!

@johnhaddon johnhaddon merged commit fdf0167 into GafferHQ:1.4_maintenance Oct 1, 2024
6 checks passed
@ericmehl ericmehl mentioned this pull request Oct 2, 2024
4 tasks
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.

2 participants