"Optimización de CSS y JavaScript" por @lucascepeda
Upcoming SlideShare
Loading in...5
×
 

"Optimización de CSS y JavaScript" por @lucascepeda

on

  • 1,122 views

Presentación realizada en el #webcat Barcelona de Marzo del 2012...

Presentación realizada en el #webcat Barcelona de Marzo del 2012

Autor: Lucas Cepeda (@lucascepeda)

------------------------------------------------
RECURSOS:

- YUI Compressor
http://developer.yahoo.com/yui/compressor/

- Minify
http://code.google.com/p/minify/

- Avoid document.write
http://code.google.com/speed/page-speed/docs/rtt.html#AvoidDocumentWrite

- JavaScript object structure: speed matters
http://jsperf.com/javascript-object-structure-speed-matters/2

- id vs class vs tag vs pseudo vs. attribute selectors
http://jsperf.com/id-vs-class-vs-tag-selectors/2

- JS: Selectores (CSS3 not vs .not)
http://jsperf.com/jquery-css3-not-vs-not

- Finding a DOM element (native vs jQuery vs Prototype)
http://jsperf.com/finding-an-element-w-jquery/6

- Loops
http://jsperf.com/loops/29

- Ternary Operators: a = false
http://jsperf.com/ternary-operators/3

- localStorage vs. Cookies
http://jsperf.com/localstorage-vs-objects/19

- Website Speed Part 1: Write More Efficient CSS
http://speckyboy.com/2011/03/08/website-speed-part-1-write-more-efficient-css

- CSS Specificity Should Be Irrelevant
http://www.impressivewebs.com/css-specificity-irrelevant/

- Optimize browser rendering
http://code.google.com/speed/page-speed/docs/rendering.html

- Our (CSS) Best Practices Are Killing US
http://www.stubbornella.org/content/2011/04/28/our-best-practices-are-killing-us/

- Performance Impact of CSS Selectors
http://www.stevesouders.com/blog/2009/03/10/performance-impact-of-css-selectors

- Page Speed Family
http://code.google.com/speed/page-speed/docs/
- Exceptional Performance
http://developer.yahoo.com/performance/

- JavaScript object structure: speed matters
http://ariya.ofilabs.com/2012/02/javascript-object-structure-speed-matters.html

- Thinking Async
http://css-tricks.com/thinking-async/

- jsPerf — JavaScript performance playground
http://jsperf.com

Statistics

Views

Total Views
1,122
Views on SlideShare
1,122
Embed Views
0

Actions

Likes
0
Downloads
3
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    "Optimización de CSS y JavaScript" por @lucascepeda "Optimización de CSS y JavaScript" por @lucascepeda Presentation Transcript

    • OptimizaciónCSS y JavaScript @lucascepeda WebcatBCN, 14/03/2012
    • Optimizaciones muy distintas ● CSS: Optimización para el desarrollador* ● JavaScript: Optimización para el usuario*@lucascepeda WebcatBCN, 14/03/2012
    • CSS: Lo que ya debes saber ● Código inline, caca ● @import, caca ● Debe ir en el <head> ● Usar shorthand@lucascepeda WebcatBCN, 14/03/2012
    • CSS: Lo que ya tendrías que hacer ● Combinar ● Minimizar ● Comprimir@lucascepeda WebcatBCN, 14/03/2012
    • CSS: Combinar <head> <link rel="stylesheet" type="text/css" href="styles/yellow.css"> <link rel="stylesheet" type="text/css" href="styles/blue.css"> <link rel="stylesheet" type="text/css" href="styles/big.css"> <link rel="stylesheet" type="text/css" href="styles/bold.css"> </head>@lucascepeda WebcatBCN, 14/03/2012
    • CSS: Combinar <head> <link rel="stylesheet" type="text/css" href="styles/combined.css"> </head>@lucascepeda WebcatBCN, 14/03/2012
    • CSS: Minimizar /***** Multi-line comment before a new class name *****/ .classname { /* comment in declaration block */ font-weight: normal; }@lucascepeda WebcatBCN, 14/03/2012
    • CSS: Minimizar .classname{font-weight:normal}@lucascepeda WebcatBCN, 14/03/2012
    • CSS: Combinar y minimizar YUI Compressor: http://developer.yahoo.com/yui/compressor/ minify: http://code.google.com/p/minify/@lucascepeda WebcatBCN, 14/03/2012
    • CSS: Comprimir En servidor (apache, node.js, lighttp, IIS...) ● gzip ● zlib@lucascepeda WebcatBCN, 14/03/2012
    • CSS: Lo que quizá no sepas ● 25K ● RTL #footer .column ul li a { color: #FAFAFA } ● CSS antes que JS en el <head>@lucascepeda WebcatBCN, 14/03/2012
    • CSS: CSS antes que JS en <head>@lucascepeda WebcatBCN, 14/03/2012
    • CSS: CSS antes que JS en <head>@lucascepeda WebcatBCN, 14/03/2012
    • CSS: Best practices ● IDs vs Clases ● Selectores eficientes ● OOCSS@lucascepeda WebcatBCN, 14/03/2012
    • CSS: Optimización prematura@lucascepeda WebcatBCN, 14/03/2012
    • CSS: Optimización prematura@lucascepeda WebcatBCN, 14/03/2012
    • CSS: Problemas conocidos ● :hover en elementos distintos que <a> ● border-radius en IE9 ● Expresiones en IE@lucascepeda WebcatBCN, 14/03/2012
    • JS: Lo que ya debes saber ● Bloques <script> al final ● Evitar document.write ● eval es evil@lucascepeda WebcatBCN, 14/03/2012
    • JS: Lo que ya tendrías que hacer ● Combinar ● Minimizar ● Comprimir@lucascepeda WebcatBCN, 14/03/2012
    • JS: Combinar@lucascepeda WebcatBCN, 14/03/2012
    • JS: Lo que quizá no sepas ● Smart Event Handler ● Mantener la estructura de los objetos ● Selectores@lucascepeda WebcatBCN, 14/03/2012
    • JS: Smart Event Handlers@lucascepeda WebcatBCN, 14/03/2012
    • JS: Mantener estructura en objetos var universe = { answer: 42 }; // do something else universe.panic = false;@lucascepeda WebcatBCN, 14/03/2012
    • JS: Mantener estructura en objetos var universe = { answer: 42, panic: true }; // do something else universe.panic = false;@lucascepeda WebcatBCN, 14/03/2012
    • JS: Mantener estructura en objetos http://jsperf.com/javascript-object-structure-speed-matters/2@lucascepeda WebcatBCN, 14/03/2012
    • JS: Selectores http://jsperf.com/id-vs-class-vs-tag-selectors/2@lucascepeda WebcatBCN, 14/03/2012
    • JS: Selectores (CSS3 not vs .not) http://jsperf.com/jquery-css3-not-vs-not@lucascepeda WebcatBCN, 14/03/2012
    • JS: Selectores (nativo vs liberías) http://jsperf.com/finding-an-element-w-jquery/6@lucascepeda WebcatBCN, 14/03/2012
    • JS: Loops http://jsperf.com/loops/29@lucascepeda WebcatBCN, 14/03/2012
    • JS: ??????Array(2).concat(b, c)[String(a).match(/(t)|(f)/).join().split(,,).push(1)]@lucascepeda WebcatBCN, 14/03/2012
    • JS: ??????Array(2).concat(b, c)[String(a).match(/(t)|(f)/).join().split(,,).push(1)][0, 1, 2, 3, b, c][String(a).length]@lucascepeda WebcatBCN, 14/03/2012
    • JS: ??????Array(2).concat(b, c)[String(a).match(/(t)|(f)/).join().split(,,).push(1)][0, 1, 2, 3, b, c][String(a).length]({ true: b, false: c})[a]@lucascepeda WebcatBCN, 14/03/2012
    • JS: ??????Array(2).concat(b, c)[String(a).match(/(t)|(f)/).join().split(,,).push(1)][0, 1, 2, 3, b, c][String(a).length]({ true: b, false: c})[a]switch(a) { case true: return b case false: return c}@lucascepeda WebcatBCN, 14/03/2012
    • JS: ternary operator vs alternatives http://jsperf.com/ternary-operators/3@lucascepeda WebcatBCN, 14/03/2012
    • JS: localStorage vs cookies http://jsperf.com/localstorage-vs-objects/19@lucascepeda WebcatBCN, 14/03/2012
    • Referencias CSS http://speckyboy.com/2011/03/08/website-speed-part-1-write-more-efficient-css http://www.impressivewebs.com/css-specificity-irrelevant/ http://code.google.com/speed/page-speed/docs/rendering.html http://www.stubbornella.org/content/2011/04/28/our-best-practices-are-killing-us/ http://www.stevesouders.com/blog/2009/03/10/performance-impact-of-css-selectors@lucascepeda WebcatBCN, 14/03/2012
    • Referencias JS http://code.google.com/speed/page-speed/docs/ http://developer.yahoo.com/performance/ http://ariya.ofilabs.com/2012/02/javascript-object-structure-speed-matters.html http://css-tricks.com/thinking-async/ http://jsperf.com@lucascepeda WebcatBCN, 14/03/2012
    • Gracias @lucascepeda WebcatBCN, 14/03/2012
    • @lucascepeda WebcatBCN, 14/03/2012