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

Unified Diff: chrome/test/data/dromaeo/tests/sunspider-math-partial-sums.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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/dromaeo/tests/sunspider-math-partial-sums.html
===================================================================
--- chrome/test/data/dromaeo/tests/sunspider-math-partial-sums.html (revision 0)
+++ chrome/test/data/dromaeo/tests/sunspider-math-partial-sums.html (revision 0)
@@ -0,0 +1,44 @@
+<html>
+<head>
+<script src="../htmlrunner.js"></script>
+<script>
+// The Computer Language Shootout
+// http://shootout.alioth.debian.org/
+// contributed by Isaac Gouy
+
+function partial(n){
+ var a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 = 0.0;
+ var twothirds = 2.0/3.0;
+ var alt = -1.0;
+ var k2 = k3 = sk = ck = 0.0;
+
+ for (var k = 1; k <= n; k++){
+ k2 = k*k;
+ k3 = k2*k;
+ sk = Math.sin(k);
+ ck = Math.cos(k);
+ alt = -alt;
+
+ a1 += Math.pow(twothirds,k-1);
+ a2 += Math.pow(k,-0.5);
+ a3 += 1.0/(k*(k+1.0));
+ a4 += 1.0/(k3 * sk*sk);
+ a5 += 1.0/(k3 * ck*ck);
+ a6 += 1.0/k;
+ a7 += 1.0/k2;
+ a8 += alt/k;
+ a9 += alt/(2*k -1);
+ }
+}
+
+window.onload = function(){ startTest("sunspider-math-partial-sums", '');
+
+test( "Partial Sums", function(){
+ partial(2048);
+});
+
+endTest(); };
+</script>
+</head>
+<body></body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698