Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
SlideShare a Scribd company logo
Performance Optimization for Sencha Touch
Performance Optimization
    for Sencha Touch

       by Tommy Maintz
        @tommymaintz
Problems
    DOM
   Events
   Drawing
 Animations
Code execution
Device specific issues
   Limited hardware acceleration
            Translate3d
DOM: Memory
  (Size matters)
One small advantage
Phones have a limited amount of screen estate
Solution
Destroy components that are not visible on the screen anymore
Cards
Modal Components
Events: Memory
Solution
Use our Event Manager
Automatic removal of listeners
Delegation for Touch events
Use event delegation when possible
Elements
Components
Drawing: GPU
No small advantage
     Devices will get faster
  Better hardware acceleration
Solution
Keep your DOM structures “light”
Light?
Limited amount of advanced CSS3
opacity & rgba
border-radius
gradients
text-shadow & box-shadows
Limit the amount and depth of DOM elements
Don’t go too deep
 Prevent unnecessary layouts
Performance Optimization for Sencha Touch
Performance Optimization for Sencha Touch
Animations: GPU
Good        Getting       Little
 enough       There        behind

            Most Android
iPhone 3GS+                 RIM
             2.2 devices
Solution
Only animate “light” DOM structures
Slide to List
Performance Optimization for Sencha Touch
Code Execution: Compiler
Not the usual suspects
    CPU’s are actually fast enough
   Javascript engines are powerful
So what is the problem?
JIT Compiler
Compilation time is related to size of file that the method
                         exists in
Complexity not relevant
Extensive comments and documentation are
Solution
Write complicated undocumented code
Actual solution
Test performance using minified and compressed code
JSBuilder 3
Cross-OS packaging, concatenation & minification
Example .jsb3
Questions?

More Related Content

Performance Optimization for Sencha Touch