Estelle Weyl
Estelle Weyl | @estellevw | Github | Press → to advance, 2 for comments, 4 to read/write notes.
Estelle Weyl
More powerful browsers.
Less powerful CPUs
Less RAM
More latency
IRL | This Room | Me | |
---|---|---|---|
RAM | 256-1024MB | 512-2048MB | |
Mean | 512MB RAM | 1024MB RAM | 16GB |
CPU | 600MHz-1.2GHz | 1.7 GHz | 2.3 |
OS | A2.3/3, iOS | A4+, iOS 6 (7), and 1 FF |
CPU Drains the battery. Avoid using it!
requestAnimationFrame
(not setInterval
or setTimeout
)and other 3rd party scripts
srcset="sm.jpg 640w, smhd.jpg 640w 2x, lghd.jpg 2x"
Optimize
<object data="data:image/svg+xml,%3Csvg%20viewBox='0%200%20300%20329'%20preserveAspectRatio='xMidYMid%20meet'%20xmlns='http://www.w3.org/2000/svg'%3E%3Ctitle%3EClown%20Car%20Technique%3C/title%3E%3Cstyle%3Esvg%7Bbackground-size:100%25%20100%25;background-repeat:no-repeat;%7D@media%20screen%20and%20(max-width:300px)%7Bsvg%7Bbackground-image:url(https://raw.github.com/estelle/clowncar/master/images/small.png);%7D%7D@media%20screen%20and%20(min-width:301px)%7Bsvg%7Bbackground-image:url(https://raw.github.com/estelle/clowncar/master/images/medium.png);%7D%7D@media%20screen%20and%20(min-width:601px)%7Bsvg%7Bbackground-image:url(https://raw.github.com/estelle/clowncar/master/images/big.png);%7D%7D%3C/style%3E%3C/svg%3E" type="image/svg+xml"> <!--[if lte IE 8]> <img src="images/medium.png" alt="Fall back for IE"> <![endif]--> </object>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 329" preserveAspectRatio="xMidYMid meet"> <title>Clown Car</title> <style> svg { background-size: 100% 100%; background-repeat: no-repeat; } @media screen and (max-width: 400px) { svg {background-image: url(images/small.png");} } @media screen and (min-width: 401px) and (max-width: 700px) { svg {background-image: url(images/medium.png);} } @media screen and (min-width: 701px) and (max-width: 1000px) { svg {background-image: url(images/big.png);} } @media screen and (min-width: 1001px) { svg {background-image: url(images/huge.png);} } </style> </svg>
Response Time
el.addEventListener('click', myFunction); el.addEventListener('touchend', myFunction);*
<meta name="viewport" content="width=device-width; initial-scale=1; maximum-scale=1;">
Frame Rate
requestAnimationFrame
(not setInterval
or setTimeout
)
Goal: New Frame every 16.67ms goal at 60hz
here is some text
GPU
PAINT
LAYOUT
Device | Memory | |
---|---|---|
iPhone 3G | 128MB | |
iPhone 3GS | 256 MB | |
HTC Inspire | 768 MB | |
iPad 1 | 256 MB | |
iPod Touch (4) | 256 MB | |
Galaxy S III | 1 GB | |
MacBook Pro | 16 GB |
T-Mobile: cheapest prepaid phone runs Android 2.3 with 256MB
Mobile Norm: 512MB of RAM, with 1GHz Processor
PC Norm: 8GB+ RAM
Running Services | ||
Other | 73MB Avail: 255MB + 182MB in 21 | |
Calendar | 8.4MB | |
Process:com.htc.bgp | ||
ObexService | 31:52:14 | |
Started by application: Touch to stop | ||
AT&T Navigator | 8.4MB | |
Process: com.telnav.app.android.congular | ||
ResoucePreLoader | Restarting | |
Started by application: Touch to stop | ||
AT&T Spots | 2.4MB | |
Process: com.matchboxmobile.wasp | ||
WispService | 31:52:14 | |
Started by application: Touch to stop | ||
Media | 4.1MB | |
Process: android.process.media | ||
DownloadService | 31:52:14 | |
Started by application: Touch to stop | ||
PVWmdrmService | 2.2MB | |
Process: com.pv.wmdrmservice | ||
PVWmdrmService | 31:52:14 | |
Started by application: Touch to stop |
More nodes = more expensive!
Pool Elements and Objects
Reuse instead of Allocate and Destroy