Performance issues and optimizations in JavaScript | Synapse