Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

[·­Òë]High Performance JavaScript(028)

JavaScript Minification  JavaScript½ô´Õ
    JavaScript minification is the process by which a JavaScript file is stripped of everything that does not contribute to its execution. This includes comments and unnecessary whitespace. The process typically reduces the file size by half, resulting in faster downloads, and encourages programmers to write better, more extensive inline documentation.
    JavaScript½ô´ÕÖ¸µÄÊÇÌÞ³ýÒ»¸öJavaScriptÎļþÖÐÒ»ÇÐÔËÐÐÎÞ¹ØÄÚÈݵĹý³Ì¡£°üÀ¨×¢ÊͺͲ»±ØÒªµÄ¿Õ¸ñ¡£¸Ã´¦Àíͨ³£¿É½«Îļþ³ß´çËõ¼õµ½Ò»°ë£¬Æä½á¹ûÊÇÏÂÔØËٶȸü¿ì£¬²¢¹ÄÀø³ÌÐòԱд³ö¸üºÃ£¬¸üÏêϸµÄÄÚÁªÎĵµ¡£
    JSMin (http://www.crockford.com/javascript/jsmin.html), developed by Douglas Crockford, remained the standard in JavaScript minification for a long time. However, as web applications kept growing in size and complexity, many felt it was time to push JavaScript minification a step further. This is the main reason behind the development of the YUI Compressor (http://developer.yahoo.com/yui/compressor/), a tool that performs all kinds of smart operations in order to offer a higher level of compaction than other tools in a completely safe way. In addition to stripping comments and unnecessary whitespace, the YUI Compressor offers the following features:
    JSMin£¨http://www.crockford.com/javascript/jsmin.html£©£¬ÓÉDouglas Crockford¿ª·¢£¬Ëü±£³ÖÁËJavaScript½ô´Õ±ê×¼ºÜ³¤Ò»¶Îʱ¼ä¡£È»¶øËæ×ÅÍøÂçÓ¦ÓóÌÐòÔÚ¹æÄ£ºÍ¸´ÔÓÐÔÉϲ»¶ÏÔö³¤£¬Ðí¶àÈËÈÏΪJavaScript½ô´ÕÓ¦µ±ÔÙÏòÇ°ÍÆ½øÒ»²½¡£ÕâÊÇ¿ª·¢YUIѹËõÆ÷µÄÖ÷ÒªÔ­Òò£¨http://developer.yahoo.com/yui/compressor/£©ËüÌṩÁËËùÓÐÀàÐ͵ÄÖÇÄܲÙ×÷£¬ÎªÁËÌṩ±ÈÆäËü¹¤¾ß¸ü¸ß¼¶µÄ½ô´Õ²Ù×÷²¢ÇÒÒÔÍêÈ«°²È«µÄ·½·¨ÊµÏÖ¡£³ýÁËÌÞ³ý×¢ÊͺͲ»±ØÒªµÄ¿Õ¸ñ£¬YUIѹËõÆ÷»¹ÌṩÒÔϹ¦ÄÜ£º
• Replacement of local variable names with shorter (one-, two-, or three-character) variable names, picked to optimize gzip compression downstream
  ½«¾Ö²¿±äÁ¿ÃûÌæ»»ÒÔ¸ü¶ÌµÄÐÎʽ£¨1¸ö£¬2¸ö£¬»ò3¸ö×Ö·û£©£¬ÒÔÓÅ»¯ºóÐøµÄgzipѹËõ¹¤×÷
• Rep


Ïà¹ØÎĵµ£º

javascriptЧÂʾ­Ñé̸(Ò»)

±¾ÎÄÖ÷ÒªÊdzöÓÚÓÐÅóÓÑʹÓÃÎÒÔ­À´Ð´µÄautocompleteµÄJS¿Ø¼þ¡£µ±Êý¾ÝÁ¿´óµÄʱºò£¬»á³öÏÖЧÂʼ«ÆäÂýµÄÇé¿ö£¬ÎÒÔÚÕâ¶Îʱ¼ä×ö³öµÄһЩ²âÊÔÒ²¼°Ò»Ð©¾­Ñ飬Óë´ó¼Ò·ÖÏí£¬Èç¹ûÓдíµÄµØ·½£¬»¹ÇëÖ¸³ö¡£
¾­¹ý²âÊÔ£¬ÎÒÃǻᷢÏÖÈçϵÄÇé¿ö»òÕß˵µÄ½áÂÛ£¬Èç¹ûÄúµÄ²âÊÔ½á¹ûÓëÎҵIJ»·û£¬Çë˵Ã÷Ô­Òò£¬ÒÔ±ãÏ໥ѧϰ¡£
1£©µ±Ò»¸ö½Ï´óµÄHTML×Ö· ......

[·­Òë]High Performance JavaScript(016)

Regular Expression Optimization  ÕýÔò±í´ïʽÓÅ»¯
    Incautiously crafted regexes can be a major performance bottleneck (the upcoming section, "Runaway Backtracking" on page 91, contains several examples showing how severe this can be), but there is a lot you can do to improve re ......

[·­Òë]High Performance JavaScript(020)

Yielding with Timers  Óö¨Ê±Æ÷Èóöʱ¼äƬ
    Despite your best efforts, there will be times when a JavaScript task cannot be completed in 100 milliseconds or less because of its complexity. In these cases, it's ideal to yield control of the UI thread so that UI updates may occur ......

[·­Òë]High Performance JavaScript(022)

µÚÆßÕ  Ajax  Òì²½JavaScriptºÍXML
    Ajax is a cornerstone of high-performance JavaScript. It can be used to make a page load faster by delaying the download of large resources. It can prevent page loads altogether by allowing for data to be transferred between the client ......

[·­Òë]High Performance JavaScript(027)

µÚ¾ÅÕÂ
Building and Deploying High-Performance JavaScript Applications
´´½¨²¢²¿Êð¸ßÐÔÄÜJavaScriptÓ¦ÓóÌÐò
    According to a 2007 study by Yahoo!'s Exceptional Performance team, 40%–60% of Yahoo!'s users have an empty cache experience, and about 20% of all page views are done ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ