Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(349)

Side by Side Diff: chrome/test/data/dromaeo/tests/sunspider-controlflow-recursive.html

Issue 269054: Importing dromaeo performance tests to src/chrome/test/data.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../htmlrunner.js"></script>
4 <script>
5 // The Computer Language Shootout
6 // http://shootout.alioth.debian.org/
7 // contributed by Isaac Gouy
8
9 function ack(m,n){
10 if (m==0) { return n+1; }
11 if (n==0) { return ack(m-1,1); }
12 return ack(m-1, ack(m,n-1) );
13 }
14
15 function fib(n) {
16 if (n < 2){ return 1; }
17 return fib(n-2) + fib(n-1);
18 }
19
20 function tak(x,y,z) {
21 if (y >= x) return z;
22 return tak(tak(x-1,y,z), tak(y-1,z,x), tak(z-1,x,y));
23 }
24
25 window.onload = function(){ startTest("sunspider-controlflow-recursive", '');
26
27 test("Ack", function(){
28 for ( var i = 3; i <= 5; i++ )
29 ack(3,i);
30 });
31
32 test("Fib", function(){
33 for ( var i = 3; i <= 5; i++ )
34 fib(17.0+i);
35 });
36
37 test("Tak", function(){
38 for ( var i = 3; i <= 5; i++ )
39 tak(3*i+3,2*i+2,i+1);
40 });
41
42 endTest(); };
43 </script>
44 </head>
45 <body></body>
46 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698