Store methods on prototype for better performance.
trusktr opened this issue · comments
threex.htmlmixer/threex.htmlmixer.js
Lines 97 to 101 in 43fdd57
Storing methods on the prototype instead of creating a new one for each constructor can perform better. Currently, if there's 100 planes, then there will be 100 instances of the update method (an instance of Function
). But if you instead store update
on the class prototype, then there will only every be one instance of the update method.
See this PR for more details.