aframe-effects
aframe-effects copied to clipboard
Unconditional debug output `console.log(source, material);` may affect performance
The debug output should only run in some debug mode (you could use the debug
package for that).
https://github.com/wizgrav/aframe-effects/blob/776d69fb4c3757b7bb544146cea164bd008b514e/systems/effects.js#L260-L270
https://github.com/wizgrav/aframe-effects/blob/c4f9cdb48cc95d2af2bc3ff4bf63edff472d3697/dist/aframe-effects.js#L496-L516
You're right, I think an approach could be to check if the debug component is set on the a-scene element. Thanks for noticing
an approach could be to check if the debug component is set on the a-scene element.
Querying the browser DOM is slow compared to querying a JS variable. Especially repeatedly.
But of course both approached should be benchmarked to find the most performant.
Using the de-facto standard debug module lets the users to remove the debug calls in production builds. Using the a-scene debug component may require extra dancing to strip that out.
Ok, can you submit a PR?