[·Òë]High Performance JavaScript(032)
Fiddler
Fiddler is an HTTP debugging proxy that examines the assets coming over the wire and helps identify any loading bottlenecks. Created by Eric Lawrence, this is a general purpose network analysis tool for Windows that provides detailed reports on any browser or web request. Visit http://www.fiddler2.com/fiddler2/ for installation and other information.
FiddlerÊÇÒ»¸öHTTPµ÷ÊÔ´úÀí£¬¼ì²é×ÊÔ´ÔÚÏß´«ÊäÇé¿ö£¬ÒÔ¶¨Î»¼ÓÔØÆ¿¾±¡£ËüÓÉEric Lawrence´´½¨£¬ÊÇÒ»¸öWindowsÏÂͨÓõÄÍøÂç·ÖÎö¹¤¾ß£¬¿ÉΪÈκÎä¯ÀÀÆ÷»òÍøÒ³ÇëÇó¸ø³öÏêϸ±¨¸æ¡£Æä°²×°ºÍÆäËüÐÅÏ¢²Î¼ûhttp://www.fiddler2.com/fiddler2/¡£
During installation, Fiddler automatically integrates with IE and Firefox. A button is added to the IE toolbar, and an entry is added under Firefox's Tools menu. Fiddler can also be started manually. Any browser or application that makes web requests can be analyzed. While running, all WinINET traffic is routed through Fiddler, allowing it to monitor and analyze the performance of downloaded assets. Some browsers (e.g., Opera and Safari) do not use WinINET, but they will detect the Fiddler proxy automatically, provided that it is running prior to launching the browser. Any program that allows for proxy settings can be manually run through Fiddler by pointing it at the Fiddler proxy (127.0.0.1, port: 8888).
ÔÚ°²×°¹ý³ÌÖУ¬FiddlerÓëIEºÍFirefox×Ô¶¯¼¯³É¡£IE¹¤¾ßÀ¸ÉϽ«Ìí¼ÓÒ»¸ö°´Å¥£¬FirefoxµÄ¹¤¾ß²Ëµ¥Öн«Ôö¼ÓÒ»¸ö²Ëµ¥Ïî¡£Fiddler»¹¿ÉÒÔÊÖ¹¤Æô¶¯¡£ÈκÎä¯ÀÀÆ÷»òÓ¦ÓóÌÐò·¢ÆðµÄÍøÒ³ÇëÇó¶¼Äܹ»·ÖÎö¡£ËüÔËÐÐʱ£¬ËùÓÐWinINETͨÐŶ¼Í¨¹ýFiddler½øÐзÓÉ£¬ÔÊÐíËü¼àÊÓ²¢·ÖÎö×ÊÔ´ÏÂÔØµÄÐÔÄÜ¡£Ä³Ð©ä¯ÀÀÆ÷£¨ÀýÈçOperaºÍSafari£©²»Ê¹ÓÃWinINET£¬µ«ËüÃÇ»á×Ô¶¯¼ì²âFiddler´úÀí£¬ÌÈÈôËüÔÚä¯ÀÀÆ÷Æô¶¯Ö®Ç°ÕýÔÚÔËÐеϰ¡£ÈκÎÄܹ»ÉèÖôúÀíµÄ³ÌÐò¶¼¿ÉÒÔÊÖ¹¤ÉèÖÃÖ¸¶¨ËüʹÓÃFiddler´úÀí£¨127.0.0.1£¬¶Ë¿Ú£º8888£©¡£
Like Firebug, Web Inspector, and Page Speed, Fiddler provides a waterfall diagram that provides insights as to which assets are taking longer to load and
Ïà¹ØÎĵµ£º
µÚÁùÕ Responsive Interfaces ÏìÓ¦½Ó¿Ú
There's nothing more frustrating than clicking something on a web page and having nothing happen. This problem goes back to the origin of transactional web applications and resulted in the now-ubiquitous "please click only once" m ......
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 ......
Data Format Conclusions Êý¾Ý¸ñʽ×ܽá
Favor lightweight formats in general; the best are JSON and a character-delimited custom format. If the data set is large and parse time becomes an issue, use one of these two techniques:
×ܵÄÀ´ËµÔ½ÇáÁ¿¼¶µÄ¸ñʽԽºÃ£¬× ......
µÚ°ËÕ Programming Practices ±à³Ìʵ¼ù
Every programming language has pain points and inefficient patterns that develop over time. The appearance of these traits occurs as people migrate to the language and start pushing its boundaries. Since 2005, when the term "Ajax" ......
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 ha ......