Estelle Weyl | @estellevw | Github | Press → to advance, 2 for comments, 4 to read/write notes.
High memory usage causes a slow UI
When you are out of memory, you are out of memory
Browser crashes to free up memory
Rendered media are still the same size.
Video, Audio, Images and Text can be compressed to save bandwidth, but they're uncompressed in the browser.
Don't send big images to small screens?
Images 1024px or bigger are too big for memory
Change your user agent and click on links above
88KB
+
4KB
<
551KB
div { background-image:url(images/frame.jpg); -webkit-mask: url(images/framemask.png); }
Static images may render faster than CSS effects
code { color: black; font-size: 85%; background-color: rgba(255,255,255,0.9); transition: all 2s ease-in 50ms; } code:hover { color: red; font-size: 120%; background-color: rgba(255,255,255,0.8); }
Requires reflow!
code { color: black; font-size: 85%; background-color: rgba(255,255,255,0.9); transition: all 2s ease-in 50ms; } code:hover { color: red; transform: scale(1.4); transform-origin: 0 0; background-color: rgba(255,255,255,0.8); }
Only repaints
div { transform: translateZ(0); }
Composited mage in memory == H x W x 4
Take advantage of hardware acceleration, but don't abuse it. GPU accelerated elements eat video memory
Background images are first rendered with image data send to Core Animation. Safari doesn't render <img> first. The decoded image file is sent, as is, pre-rendered, to the Core Animation as a new layer. Foreground images is sent to Core Animation as image data which it has to keep in graphics memory. This uses more memory.
When visual changes do NOT require recalculation of layout
When visual changes REQUIRE recalculation of layout
More nodes = more expensive!
Pool Elements and Objects
Reuse instead of Allocate and Destroy
npm -g install weinre
weinre
<script src="http://localhost:8080/target/target-script-min.js#anonymous"></script>
http://localhost:8080/client/
Basically, Weinre on crack, and free version is like automated Weinre.