JavaScript constructs/patterns to avoid on iOS Safari? -
i have web app contains huge amount of generated javascript. memory consumption differs factor 6 between running web app in chrome on desktop compared running web app in uiwebview
on (updated) ipad.
what constructs or patterns should avoid memory consumption on ios on par of chrome?
characterisation of generated javascript:
- the code generated haxe.
- the code "object oriented" in makes heavy use of
prototype
, in civilized way. - the code makes heavy use of named indexes on javascript objects implement hash tables.
- there lot of strings, hardly string concatenations.
there not appear memory leaks; excessive memory consumption on ios shows upon construction of (fixed set of) javascript objects.
since code run on desktop underlying quirk in ios. doubt can fix using more object oriented way of programming. sure might reduce memory footprint bit not factor of 6.
uiwebview quite notorious creating memory leaks try use newer (ios 8+) wkwebview has much better garbage collection.
Comments
Post a Comment