ÈçºÎÎÒjavaScript»ñÈ¡´°¿ÚµÄ¸ß¶ÈºÍ¿í¶È
ÔÚjavascriptÖеõ½µ±Ç°´°¿ÚµÄ¸ßºÍ¿í
<body><SCRIPT LANGUAGE="JavaScript">
var s = "";
s += "\r\nÍøÒ³¿É¼ûÇøÓò¿í£º"+ document.body.clientWidth;
s += "\r\nÍøÒ³¿É¼ûÇøÓò¸ß£º"+ document.body.clientHeight;
s += "\r\nÍøÒ³¿É¼ûÇøÓò¿í£º"+ document.body.offsetWidth +" (°üÀ¨±ßÏߺ͹ö¶¯ÌõµÄ¿í)";
s += "\r\nÍøÒ³¿É¼ûÇøÓò¸ß£º"+ document.body.offsetHeight +" (°üÀ¨±ßÏߵĿí)";
s += "\r\nÍøÒ³ÕýÎÄÈ«ÎÄ¿í£º"+ document.body.scrollWidth;
s += "\r\nÍøÒ³ÕýÎÄÈ«Îĸߣº"+ document.body.scrollHeight;
s += "\r\nÍøÒ³±»¾íÈ¥µÄ¸ß£º"+ document.body.scrollTop;
s += "\r\nÍøÒ³±»¾íÈ¥µÄ×ó£º"+ document.body.scrollLeft;
s += "\r\nÍøÒ³ÕýÎIJ¿·ÖÉÏ£º"+ window.screenTop;
s += "\r\nÍøÒ³ÕýÎIJ¿·Ö×ó£º"+ window.screenLeft;
s += "\r\nÆÁÄ»·Ö±æÂʵĸߣº"+ window.screen.height;
s += "\r\nÆÁÄ»·Ö±æÂÊµÄ¿í£º"+ window.screen.width;
s += "\r\nÆÁÄ»¿ÉÓù¤×÷Çø¸ß¶È£º"+ window.screen.availHeight;
s += "\r\nÆÁÄ»¿ÉÓù¤×÷Çø¿í¶È£º"+ window.screen.availWidth;
s += "\r\nÄãµÄÆÁÄ»ÉèÖÃÊÇ "+ window.screen.colorDepth +" λ²ÊÉ«";
s += "\r\nÄãµÄÆÁÄ»ÉèÖà "+ window.screen.deviceXDPI +" ÏñËØ/Ó¢´ç";
alert(s);
</SCRIPT>
Ïà¹ØÎĵµ£º
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 ......
Use the Fast Parts ʹÓÃËٶȿìµÄ²¿·Ö
Even though JavaScript is often blamed for being slow, there are parts of the language that are incredibly fast. This should come as no surprise, since JavaScript engines are built in lower-level languages and are therefore compiled. Thou ......
µÚ¾ÅÕÂ
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 ......
Summary ×ܽá
When web pages or applications begin to feel slow, analyzing assets as they come over the wire and profiling scripts while they are running allows you to focus your optimization efforts where they are needed most.
µ±ÍøÒ³»òÓ¦ÓóÌÐò±äÂýʱ£¬·ÖÎ ......