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

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

Firebug
    Firefox is a popular browser with developers, partially due to the Firebug addon (available at http://www.getfirebug.com/), which was developed initially by Joe Hewitt and is now maintained by the Mozilla Foundation. This tool has increased the productivity of web developers worldwide by providing insights into code that were never before possible.
    ¶Ô¿ª·¢ÈËÔ±À´Ëµ£¬FirefoxÊÇÒ»¸öʱ÷ÖµÄä¯ÀÀÆ÷£¬²¿·ÖÔ­ÒòÊÇFirebug²å¼þ£¨http://www.getfirebug.com/£©ÓÉJoe HewittÊ×´´ÏÖÔÚÓÉMozilla»ù½ð»áά»¤¡£´Ë¹¤¾ß¾ßÓÐÇ°ËùδÓеĴúÂ붴²ìÁ¦£¬Ìá¸ßÁËÈ«ÊÀ½çÍøÒ³¿ª·¢ÕßµÄÉú²úÁ¦¡£
    Firebug provides a console for logging output, a traversable DOM tree of the current page, style information, the ability to introspect DOM and JavaScript objects, and more. It also includes a profiler and network analyzer, which will be the focus of this section. Firebug is also highly extensible, enabling custom panels to be easily added.
    FirebugÌṩÁËÒ»¸ö¿ØÖÆ̨ÈÕÖ¾Êä³ö£¬µ±Ç°Ò³ÃæµÄDOMÊ÷ÏÔʾ£¬ÑùʽÐÅÏ¢£¬Äܹ»·´¹ÛDOMºÍJavaScript¶ÔÏó£¬ÒÔ¼°¸ü¶à¹¦ÄÜ¡£Ëü»¹°üÀ¨Ò»¸öÐÔÄܺÍÍøÂç·ÖÎöÆ÷£¬ÕâÊDZ¾½ÚµÄÖص㡣FirebugÒ×ÓÚÀ©Õ¹£¬¿ÉÌí¼Ó×Ô¶¨ÒåÃæ°å¡£
Console Panel Profiler  ¿ØÖÆ̨Ãæ°å·ÖÎöÆ÷
    The Firebug Profiler is available as part of the Console panel (see Figure 10-1). It measures and reports on the execution of JavaScript on the page. The report details each function that is called while the profiler is running, providing highly accurate performance data and valuable insights into what may be causing scripts to run slowly.
    Firebug·ÖÎöÆ÷ÊÇ¿ØÖÆ̨Ãæ°åµÄÒ»²¿·Ö£¨Èçͼ10-1£©¡£Ëü²âÁ¿²¢±¨¸æÒ³ÃæÖÐÔËÐеÄJavaScript¡£µ±·ÖÎöÆ÷ÔËÐÐʱ£¬±¨¸æÉîÈ뵽ÿ¸ö±»µ÷Óú¯ÊýµÄϸ½Ú£¬Ìṩ¸ß¾«È·µÄÐÔÄÜÊý¾ÝºÍ±äÁ¿²ì¿´¹¦ÄÜ£¬£¨ÓÐÖúÓÚ£©ÕÒ³ö¿ÉÄܵ¼Ö½ű¾ÔËÐбäÂýµÄÔ­Òò¡£
Figure 10-1. FireBug Console panel
ͼ 10-1  FireBug¿ØÖÆ̨Ãæ°å
    One way to run a profile is by clicking the Profile button, triggering the script, and clicking the P


Ïà¹ØÎĵµ£º

AJAX (Òì²½ JavaScript ºÍ XML)

AJAX (Òì²½ JavaScript ºÍ XML) ÊǸöвúÉúµÄÊõÓï,רΪÃèÊöJavaScriptµÄÁ½ÏîÇ¿´óÐÔÄÜ.ÕâÁ½ÏîÐÔ
ÄÜÔÚ¶àÄêÀ´Ò»Ö±±»ÍøÂ翪·¢ÕßËùºöÂÔ,Ö±µ½×î½üGmail, Google suggestºÍgoogle MapsµÄºá¿Õ³öÊÀ²ÅʹÈË
ÃÇ¿ªÊ¼Òâʶµ½ÆäÖØÒªÐÔ.
ÕâÁ½Ïî±»ºöÊÓµÄÐÔÄÜÊÇ:
* ÎÞÐèÖØÐÂ×°ÔØÕû¸öÒ³Ãæ±ãÄÜÏò·þÎñÆ÷·¢ËÍÇëÇó.
* ¶ÔXMLÎĵµµÄ½âÎöºÍ´¦Àí£® ......

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

A Note on Benchmarking  ²âÊÔ»ù׼˵Ã÷
    Because a regex's performance can be wildly different depending on the text it's applied to, there's no straightforward way to benchmark regexes against each other. For the best result, you need to benchmark your regexes on test strings o ......

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

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:
    ×ܵÄÀ´ËµÔ½ÇáÁ¿¼¶µÄ¸ñʽԽºÃ£¬× ......

[·­Òë]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ºÅ