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

Fixing Web Application Performance

Fixing Web Application Performance

Avatar for Kamil Kaczmarczyk

Kamil Kaczmarczyk

February 01, 2016

Other Decks in Programming

Transcript

  1. Super slow It is really slow. Application runs bit slow.

    Performance is sometimes a little slow though Not, it is too slow. Could be faster though. Powerful but slow. Slow performance of the server. slow as hell loading time and performance rather slow Works slowly. CLoud performance isn't good
  2. User Timing performance.mark(name) - mark time performance.measure(name, startMark, endMark) define

    a “measure” - time between certain entries performance.getEntriesByType(type) - fetch entries
  3. User Timing function() { performance.mark('task.start'); doTask(); performance.mark('task.end'); initComments() performance.mark('comments.init'); performance.measure('task',

    'task.start', 'task.end'); performance.measure('comments', 'comments.init', 'domContentLoaded'); measures = performance.getEntriesByType('measure'); measures.forEach(function(entry) { console.log(entry.name + ' took ' + entry.duration + 'ms'); }) }
  4. Avoid redirects • Redirects cause roundtrips • Try to avoid

    them wherever possible: • link to final destination • use History API Browser Application GET /MyHome/ 302 /Dashboard.html GET /Dashboard.html 200 /Dashboard.html
  5. Flush Head Early • Flush <head> with the resource links

    • Let the browser download resources before response is fully generated Browser Application GET /MyHome/ <head> with resources rest of the response
  6. Reduce number of connections • CSS, JS concatenation • inlining

    • domain sharding HTTP/1.1 limits number of connections to ~6 per origin