English 中文(简体)
What are the individual tests SunSpider JavaScript benchmark runs?
原标题:

Can someone explain to me what each SunSpider subtest actually checks and give a real-life equivalent of their importance and use? Which outcomes (ie times) are considered acceptable for a modern system?

The only information I have found so far was generic for each subsection, at Coding Horror.

3d Pure JavaScript computations of the kind you might use to do 3d rendering, but without the rendering. This ends up mostly hitting floating point math and array access.

access Array, object property and variable access.

bitops Bitwise operations, these can be useful for various things including games, mathematical computations, and various kinds of encoding/decoding. It s also the only kind of math in JavaScript that is done as integer, not floating point.

controlflow Control flow constructs (looping, recursion, conditionals). Right now it mostly covers recursion, as the others are pretty well covered by other tests.

crypto Real cryptography code, mostly covers bitwise operations and string operations.

date Performance of JavaScript s "date" objects.

math Various mathematical type computations.

regexp Regular expressions. Pretty self-explanatory.

string String processing, including code to generate a giant "tagcloud", extracting compressed JS code, etc.

But what about the individual tests in each subsection?

For example the "access" subsection has 4 tests (binary-trees, fannkuch, nbody, nsieve). What does each calculate and why/when should be important in a real web application that makes use of JavaScript?

最佳回答

Check out Jeff s comment 6-th from the top in your linked article. He tells you how to view the details behind each specific test, although it won t actually give us the reasoning behind each specific test. For that you ll probably have to go to the source (the Apple Webkit team):

Freiheit, I too wish there was more documentation and explanation of each test.

Here s a complete list of the tests:

var tests = [ "3d-cube", "3d-morph", "3d-raytrace", "access-binary-trees", "access-fannkuch", "access-nbody", "access-nsieve", "bitops-3bit-bits-in-byte", "bitops-bits-in-byte", "bitops-bitwise-and", "bitops-nsieve-bits", "controlflow-recursive", "crypto-aes", "crypto-md5", "crypto-sha1", "date-format-tofte", "date-format-xparb", "math-cordic", "math-partial-sums", "math-spectral-norm", "regexp-dna", "string-base64", "string-fasta", "string-tagcloud", "string-unpack-code", "string-validate-input" ];

To load each one, add it to the URL like so:

http://webkit.org/perf/sunspider-0.9/3d-cube.html

Then simply view source; each test is contained in an embedded script tags in the page.

Jeff Atwood on December 19, 2007 7:54 PM

So for access-fannkuch, go to http://www2.webkit.org/perf/sunspider-0.9/access-fannkuch.html and view the source, which shows you the actual code of the test.

Some have some useful info or links in the source page.

Others appear to be somewhat "standard" programming language benchmarks. See http://www.haskell.org/haskellwiki/Shootout/Fannkuch for example.

Others you ll just have to follow the logic of the function to see what they re actually doing.

问题回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签