InvokeAI icon indicating copy to clipboard operation
InvokeAI copied to clipboard

perf(ui): rendering optimizations

Open psychedelicious opened this issue 1 year ago • 0 comments

Summary

Handful of optimizations implemented while attempting to get a performant full canvas preview (unfortunately unsuccessful).

  • Do not rely on internal Konva API for layer preview canvas (indirectly addresses #6950)
  • Track whether layers intersect the bbox
  • Track whether layers are on-screen
  • Disable Konva's "perfect draw" for all shapes
  • Hide layers when they are both off-screen and not the selected layer
  • Throttle opacity and compositing fill rendering to 100ms
  • Reduce compositing rect rendering to minimum

Related Issues / Discussions

Closes #6950

QA Instructions

Have a play, should be no change to behaviour. I think I can feel it is a bit snappier but could be wishful thinking.

Merge Plan

n/a

Checklist

  • [x] The PR has a short but descriptive title, suitable for a changelog
  • [ ] Tests added / updated (if applicable)
  • [ ] Documentation added / updated (if applicable)

psychedelicious avatar Oct 08 '24 07:10 psychedelicious