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 gen开发者_JAVA技巧eric 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.
10 from The Computer Language Benchmarks Game -
"access-binary-trees"
"access-fannkuch"
"access-nbody"
"access-nsieve"
"bitops-nsieve-bits"
"controlflow-recursive"
"math-partial-sums"
"math-spectral-norm"
"regexp-dna"
"string-fasta"
精彩评论