Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Memory optimizations for your JS app to increase performance

Manan
November 16, 2013

Memory optimizations for your JS app to increase performance

This talk will discuss how we can scale heavy JS applications without them becoming non-performant. With increasing capabilities of modern web browsers, different frameworks allow developers to do more with less amount of code. This however, may lead to situations in which the code written is not very efficient and may lead to performance bottlenecks upon scaling. The audience can expect to understand the workings of various JS engines and understand how optimized code can significantly improve performance.

Manan

November 16, 2013
Tweet

More Decks by Manan

Other Decks in Technology

Transcript

  1. Why? “Whereas early web sites used JavaScript to perform simple

    tasks, the language is now used to run the entire user interface in many places.” “The best way to ensure a fast, enjoyable user interface is to write JavaScript as efficiently as possible for all browsers.” - Even faster websites, O’Reilly Saturday, November 16, 13
  2. Why? “Whereas early web sites used JavaScript to perform simple

    tasks, the language is now used to run the entire user interface in many places.” “The best way to ensure a fast, enjoyable user interface is to write JavaScript as efficiently as possible for all browsers.” - Even faster websites, O’Reilly Saturday, November 16, 13
  3. Why? “Whereas early web sites used JavaScript to perform simple

    tasks, the language is now used to run the entire user interface in many places.” “The best way to ensure a fast, enjoyable user interface is to write JavaScript as efficiently as possible for all browsers.” - Even faster websites, O’Reilly Saturday, November 16, 13
  4. Garbage Collection “Only if something does not have a retaining

    path to the root node, it is garbage” - Google I/O 2013 - A Trip Down Memory Lane with Gmail Saturday, November 16, 13
  5. Garbage Collection “Only if something does not have a retaining

    path to the root node, it is garbage” root object Node scalar Node - Google I/O 2013 - A Trip Down Memory Lane with Gmail Saturday, November 16, 13
  6. Garbage Collection “Only if something does not have a retaining

    path to the root node, it is garbage” root object Node scalar Node - Google I/O 2013 - A Trip Down Memory Lane with Gmail Saturday, November 16, 13
  7. Garbage Collection “Only if something does not have a retaining

    path to the root node, it is garbage” root object Node scalar Node - Google I/O 2013 - A Trip Down Memory Lane with Gmail Saturday, November 16, 13
  8. Garbage Collection “Only if something does not have a retaining

    path to the root node, it is garbage” root object Node scalar Node {...} - Google I/O 2013 - A Trip Down Memory Lane with Gmail Saturday, November 16, 13
  9. Event binding etiquettes setTimeout with clearTimeout Small callback functions: 2-3

    ms to execute DOM caching to prevent re lookup Saturday, November 16, 13
  10. Closures & Timers var  myObj  =  {      

     callMe:  function  ()  {                var  myRef  =  this;                var  val  =  setTimeout(function  ()  {                          console.log('Time  is  running  out!');                          myRef.callMe();                },  1000);        } }; myObj.callMe(); Saturday, November 16, 13