foundryvtt icon indicating copy to clipboard operation
foundryvtt copied to clipboard

Significant `FogManager#save` improvements

Open dev7355608 opened this issue 3 years ago • 2 comments

What happened?

Not a bug, but saving the fog spends roughly 2/3 of the time with unpremultiplying (arrayPostDivide). Because the fog texture is opaque, this is actually unnecessary. Also the saved fog texture and committed texture have the same size: so the pixels can be directly extracted.

https://github.com/dev7355608/perfect-vision/blob/9e2263b77920bf63068f917171a1f37b78da5269/patches/fog.js#L259-L271 https://github.com/dev7355608/perfect-vision/blob/9e2263b77920bf63068f917171a1f37b78da5269/patches/fog.js#L412-L417

What ways of accessing Foundry can you encounter this issue in?

  • [X] Native App (Electron)
  • [ ] Chrome
  • [ ] Firefox
  • [ ] Safari
  • [ ] Other

Reproduction Steps

.

What core version are you reporting this for?

Version 10 Stable 1 (build 284)

Relevant log output

No response

Bug Checklist

  • [X] The issue occurs while all Modules are disabled

dev7355608 avatar Sep 05 '22 19:09 dev7355608

Very cool. Thanks for identifying this and sharing it with us. This sounds like an easy win for performance.

aaclayton avatar Sep 05 '22 20:09 aaclayton

Postponed for v11.

Feu-Secret avatar Sep 07 '22 13:09 Feu-Secret