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

Unified Diff: chrome/test/data/dromaeo/tests/sunspider-access-nsieve.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-access-nsieve.html
===================================================================
--- chrome/test/data/dromaeo/tests/sunspider-access-nsieve.html (revision 0)
+++ chrome/test/data/dromaeo/tests/sunspider-access-nsieve.html (revision 0)
@@ -0,0 +1,48 @@
+<html>
+<head>
+<script src="../htmlrunner.js"></script>
+<script>
+// The Great Computer Language Shootout
+// http://shootout.alioth.debian.org/
+//
+// modified by Isaac Gouy
+
+function pad(number,width){
+ var s = number.toString();
+ var prefixWidth = width - s.length;
+ if (prefixWidth>0){
+ for (var i=1; i<=prefixWidth; i++) s = " " + s;
+ }
+ return s;
+}
+
+function nsieve(m, isPrime){
+ var i, k, count;
+
+ for (i=2; i<=m; i++) { isPrime[i] = true; }
+ count = 0;
+
+ for (i=2; i<=m; i++){
+ if (isPrime[i]) {
+ for (k=i+i; k<=m; k+=i) isPrime[k] = false;
+ count++;
+ }
+ }
+ return count;
+}
+
+window.onload = function(){ startTest("sunspider-access-nsieve", '');
+
+test( "N-Sieve", function(){
+ for ( var i = 1; i <= 2; i++ ) {
+ var m = (1<<i)*10000;
+ var flags = Array(m+1);
+ nsieve(m,flags);
+ }
+});
+
+endTest(); };
+</script>
+</head>
+<body></body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698