Well, I've been scrambling around stackoverflow to see if I can squeeze any small performance differences from any functions.
http://stackoverflow.com/questions/441893/which-is-faster-math-absvalue-or-value-1Minute differences for commonly used functions in my code.
I've written a neat little custom code object, calculate.js, that attempts to find fast ways to solve problems. But that's all I've done scripting wise.
To answer your question:
I would love to find out why it is exactly that my game performs so slowly under HTML5 using the Metro Interface, yet I can overclock (;-)) to about 40 FPS in any browser that isn't Firefox. The lag is terrible... I wonder, should I not attempt to embed everything into one single file? Or would SGDK2 still attempt to load everything at runtime. I'll look into my code.
I'm not sure why exactly it is that the code lags. I'm sure I can eventually get to the scaling issue using the ViewBox property Windows offers (Without butchering mouse input recognition by scaling). C# seemed appealing because it offered me a chance to set the resolution of the display device. HTML5 does not allow this.
The modulates could probably become supported using CSS wizardry, but even that wouldn't do anything necessarily for performance.... It would probably further cripple rendering time.
img {
image-rendering: optimizeSpeed;
image-rendering: -moz-crisp-edges; /* Firefox */
image-rendering: -o-crisp-edges; /* Opera */
image-rendering: -webkit-optimize-contrast; /* Chrome (and eventually Safari) */
image-rendering: optimize-contrast; /* CSS3 Proposed */
-ms-interpolation-mode: nearest-neighbor; /* IE8+ */
}
This is something that I used to use in my style for my webpages. It increased rendering time by a factor of 1.5 (Self calculation?). It removes Anti Aliasing and allows graphics to be rendered with pixelated edges (Similar to the Nearest/Linear hotfix I mentioned in C#)
It sadly only transforms images rendered outside of <canvas> I'm trying to find a way to get this line of code running inside of <canvas> It might help just a little
Profilers are telling me that ExecuteRules is the most executed function in JavaScript. Does it execute even for sprites without any rules?
(Off Topic: There were quite a few developers who re-released games on Windows 8 with slightly changed graphics each time, Pizza Guy and Taco Man, it's interesting, someone profited 200 dollars from this)
EDIT: Come to think of it, it I can get the above snippet working, then I can manually scale up and down mouse input per device. Nearest would theoretically remove the scale lines.