Commit 68247783 authored by mjs's avatar mjs

Added a random JS benchmark.

        * misc/morph.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20303 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 84b5b749
2007-03-18 Maciej Stachowiak <mjs@apple.com>
Added a random JS benchmark.
* misc/morph.html: Added.
2007-03-14 Kevin McCullough <kmccullough@apple.com>
Reviewed by .
......
<HTML>
<HEAD>
<TITLE>Mesh Transfrom</TITLE>
</HEAD>
<BODY>
<h1>Mesh Transfrom Benchmark</h1>
<SCRIPT>
var loops = 60
var nx = 120
var nz = 120
function morph(a,f) {
var PI2nx = Math.PI * 8/nx
var sin = Math.sin
var f30 = -(50 * sin(f*Math.PI*2))
for (var i = 0; i < nz; ++i) {
for (var j = 0; j < nx; ++j) {
a[3*(i*nx+j)+1] = sin((j-1) * PI2nx ) * -f30
}
}
}
var a = Array()
for (var i=0; i < nx*nz*3; ++i) a[i] = 0
var startTime=new Date() ;
for (var i = 0; i < loops; ++i) {
morph(a, i/loops)
}
var endTime=new Date() ;
document.write("Result is "+(endTime-startTime)+" ms")
</SCRIPT>
</HTML>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment