performance codificando night week 2016

28
Performance Codificando Night Week 2016

Upload: rodolfo-fadino-junior

Post on 10-Jan-2017

160 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Performance Codificando Night Week 2016

Performance

Codificando Night Week 2016

Page 2: Performance Codificando Night Week 2016

Rodolfo Fadino• Microsoft MVP• Especialista em desenvolvimento web• Tecnologia em Processamento de Dados

FATEC-SP• Portal Minha Vida

Page 3: Performance Codificando Night Week 2016
Page 4: Performance Codificando Night Week 2016

! Instantâneo

Page 5: Performance Codificando Night Week 2016

Soma de fatores

Back-End• Cache• Thread• Debug/Release• SQL• IO• Network• ...

Front-End• CSS• JS• IMG• Headers• Minified• CDN• Proxy• Cookies• ...

Page 6: Performance Codificando Night Week 2016

Vamos fazer um projeto para isso

Page 7: Performance Codificando Night Week 2016

Backlog

Page 8: Performance Codificando Night Week 2016

Melhorar a performance é uma responsabilidade nossa (desenvolvedor)

Page 9: Performance Codificando Night Week 2016

Soma de fatores

Back-End• Cache• Thread• Debug/Release• SQL• IO• Network• ...

Front-End• CSS• JS• IMG• Headers• Minified• CDN• Proxy• Cookies• ...

Page 10: Performance Codificando Night Week 2016

BACK-END

Page 11: Performance Codificando Night Week 2016

Cache

• “A melhor solução de performance é fazer com que o seu código não seja executado o tempo todo!” Tarifa, Alexandre

Page 12: Performance Codificando Night Week 2016

Demo

Cache de objetos

Page 13: Performance Codificando Night Week 2016

ORM

• Conheça as consultas e como seu ORM está trabalhando os dados

• Teste e analise quais features são importantes antes de começar a utilizar um (EF, Dapper,ADO,etc)

Page 14: Performance Codificando Night Week 2016

Demo

ORM

Page 15: Performance Codificando Night Week 2016

Requests e o Thread Pool

Processando Requisições Assíncronas (Garçom restaurante)

Page 16: Performance Codificando Night Week 2016

Task-based Asynchronous Pattern (TAP)

Task Parallel Library (TPL)Baseada no conceito de TasksMaior eficiência no uso dos recursos computacionaisMelhor controle programático das Threads

Page 17: Performance Codificando Night Week 2016

API

Page 18: Performance Codificando Night Week 2016

API

CacheJSONGzipOData

Page 19: Performance Codificando Night Week 2016

FRONT-END

Page 20: Performance Codificando Night Week 2016

• “…only 10-20% of the total end-user response time is spent getting the HTML document to the browser. You need to focus on the other 80-90% if you want to make your pages noticeably faster…” (Steve Souders)

Page 21: Performance Codificando Night Week 2016

14 regras• Rule 1 - Make Fewer HTTP Requests• Rule 2 - Use a Content Delivery Network• Rule 3 - Add an Expires Header• Rule 4 - Gzip Components• Rule 5 - Put Stylesheets at the Top• Rule 6 - Put Scripts at the Bottom• Rule 7 - Avoid CSS Expressions• Rule 8 - Make JavaScript and CSS External• Rule 9 - Reduce DNS Lookups• Rule 10 - Minify JavaScript• Rule 11 - Avoid Redirects• Rule 12 - Remove Duplicate Scripts• Rule 13 - Configure ETags• Rule 14 - Make AJAX Cacheable

Page 22: Performance Codificando Night Week 2016

Anatomia de uma requisição HTTP

• DNS Lookup• Initial Connection– Keep-Alive Header

• Time to First Byte• Content Download

Page 23: Performance Codificando Night Week 2016

CSS e JS

• Bundling• Minification

• CSS– Header

• JS– Assíncrono– Mais próximo do final

Page 24: Performance Codificando Night Week 2016

DemoBundlingMinification

Page 25: Performance Codificando Night Week 2016

Imagens

• Expires– Handler– Imagens fisicas

• Lazy Load– Dependendo do cenário

• Sprites• Otimizar– RIOT

Page 26: Performance Codificando Night Week 2016

DemoImagens

Page 27: Performance Codificando Night Week 2016

Dicas Rápidas

• Debug/Release• UrlRewrite• SQL Plano de execução• Glimpse

Page 28: Performance Codificando Night Week 2016

Obrigado

• @rodolfofadino• http://rodolfofadino.com.br