forwiz.blogg.se

Kb games free
Kb games free




kb games free

For non globals, within functions, create variables for any object properties or methods that are called multiple times to be worth it like in formulas where obj.width/height is called 4-5 times, the minifier can't optimize the property name.Ĥ. Create variables for global object properties, especially if used multiple times or they have longer names (Object.assign, Object.hasOwnProperty, s, Math.sin, JSON.stringify).ģ. Create variables for any global/builtins (setTimeout/clearTimeout, requestAnimationFrame, etc) at the top of the file.Ģ. Probably 5-10% savings by doing this for the Math methods.ġ. It also has the benefit of eliminating an object property lookup which is significantly slower than accessing a variable (under a microscope of course, if called many times). This allows the minifier to stop using the longer method names.

kb games free

You could get the minified code size lower with a few tricks below.






Kb games free