ceramic-engine / ceramic

Cross-platform 2D framework written in Haxe that can export natively to desktop (windows, mac, linux), mobile (ios, android), web (js + webgl) and to unity projects
MIT License
260 stars 22 forks source link

Review array usage on web target #113

Open jeremyfa opened 1 year ago

jeremyfa commented 1 year ago

Ceramic is pretty well optimised when targeting C++. It also runs fairly well on Web/JS. That said there are several places where arrays are initialized/updated in a way that will create sparse arrays on JS runtimes, which can affect performances if these arrays are used a lot.

Code at those places should be updated so that it sticks internally to contiguous typed arrays which will be better optimised by JS runtimes. Overall it is not a difficult task, just needs some time to review the places that can be improved.