Investigate strict mode performance
We may be able to get a performance boost by using JavaScript's strict mode in our library. Someone should test performance with and without strict mode in different browsers. The bars example (examples/01_bars.html) could be a good way to test the performance, especially when combined with a profiling tool.
I get 3-5fps lower than "non-strict", i interested to this, because, my js based on tween.js
I got the same drop in framerate when switching both Tween.js and the script in 01_bars.html to strict mode.
However, it looks like the issue is the following code in 01_bars.html:
var updateCallback = function() {
this.domElement.style.left = this.x + 'px';
}
This code is taking most of the CPU time and it runs slower in strict mode. I did another test by turning strict mode on only in Tween.js, and the performance was better in strict mode.
We should run some performance tests with the other examples.
@mikebolt Yes, we need some examples for performance. I interested. Contact me via e-mail, if i need in tests
@mikebolt If we can get performance that you said as improved. We can catch GSAP Performance. It's very amazing, yes?
This is probably a good moment to remind ourselves that we actually do not have a way of measuring performance properly! I created this issue to start a discussion about it: https://github.com/tweenjs/discuss/issues/3
@mikebolt I removed 'good first bug' because I don't think it's reasonable to expect someone to solve the 'benchmark performance' issue and 'strict mode performance' in just one go =)
You can see my note about it here
with
"use strict"performance maybe improved by almost15%, but someAndroid <5has bugs with"use strict"and may not load script and tweening doesn't runs. Sorry :(. If you want use it, please just paste
(function(){
"use strict"; // here paste
and done. You have better performance :)