From 4942b86653de8f15bdd59ed600138a0ec58bb93e Mon Sep 17 00:00:00 2001 From: "mjs@apple.com" Date: Sat, 2 Jul 2011 21:09:43 +0000 Subject: [PATCH] 2011-07-02 Maciej Stachowiak Reviewed by Anders Carlsson. SunSpider: all four bitops benchmarks can be replaced with NOP https://bugs.webkit.org/show_bug.cgi?id=38446 * tests/sunspider-1.0/bitops-3bit-bits-in-byte.js: (TimeFunc): Save the result. * tests/sunspider-1.0/bitops-bits-in-byte.js: (TimeFunc): Save the result. * tests/sunspider-1.0/bitops-bitwise-and.js: More explicitly save the results. * tests/sunspider-1.0/bitops-nsieve-bits.js: (sieve): Save the result. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@90319 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- PerformanceTests/SunSpider/ChangeLog | 16 ++++++++++++++++ .../sunspider-1.0/bitops-3bit-bits-in-byte.js | 8 ++++++-- .../tests/sunspider-1.0/bitops-bits-in-byte.js | 8 ++++++-- .../tests/sunspider-1.0/bitops-bitwise-and.js | 2 ++ .../tests/sunspider-1.0/bitops-nsieve-bits.js | 3 ++- 5 files changed, 32 insertions(+), 5 deletions(-) diff --git a/PerformanceTests/SunSpider/ChangeLog b/PerformanceTests/SunSpider/ChangeLog index fedbcd89273d..2b5aa1ba5707 100644 --- a/PerformanceTests/SunSpider/ChangeLog +++ b/PerformanceTests/SunSpider/ChangeLog @@ -1,3 +1,19 @@ +2011-07-02 Maciej Stachowiak + + Reviewed by Anders Carlsson. + + SunSpider: all four bitops benchmarks can be replaced with NOP + https://bugs.webkit.org/show_bug.cgi?id=38446 + + * tests/sunspider-1.0/bitops-3bit-bits-in-byte.js: + (TimeFunc): Save the result. + * tests/sunspider-1.0/bitops-bits-in-byte.js: + (TimeFunc): Save the result. + * tests/sunspider-1.0/bitops-bitwise-and.js: More explicitly + save the results. + * tests/sunspider-1.0/bitops-nsieve-bits.js: + (sieve): Save the result. + 2011-07-02 Maciej Stachowiak SunSpider: string-validate-input.js uses an undeclared variable named 'name', which is a DOM API diff --git a/PerformanceTests/SunSpider/tests/sunspider-1.0/bitops-3bit-bits-in-byte.js b/PerformanceTests/SunSpider/tests/sunspider-1.0/bitops-3bit-bits-in-byte.js index 1d85406809bd..ab3d7dec5390 100644 --- a/PerformanceTests/SunSpider/tests/sunspider-1.0/bitops-3bit-bits-in-byte.js +++ b/PerformanceTests/SunSpider/tests/sunspider-1.0/bitops-3bit-bits-in-byte.js @@ -1,5 +1,7 @@ // Copyright (c) 2004 by Arthur Langereis (arthur_ext at domain xfinitegames, tld com +var result = 0; + // 1 op = 6 ANDs, 3 SHRs, 3 SHLs, 4 assigns, 2 ADDs // O(1) function fast3bitlookup(b) { @@ -25,8 +27,10 @@ addr3,r3,r10 function TimeFunc(func) { var x, y, t; +var sum = 0; for(var x=0; x<500; x++) -for(var y=0; y<256; y++) func(y); +for(var y=0; y<256; y++) sum += func(y); +return sum; } -TimeFunc(fast3bitlookup); +sum = TimeFunc(fast3bitlookup); diff --git a/PerformanceTests/SunSpider/tests/sunspider-1.0/bitops-bits-in-byte.js b/PerformanceTests/SunSpider/tests/sunspider-1.0/bitops-bits-in-byte.js index 9a3acd4f77b1..ebde79949293 100644 --- a/PerformanceTests/SunSpider/tests/sunspider-1.0/bitops-bits-in-byte.js +++ b/PerformanceTests/SunSpider/tests/sunspider-1.0/bitops-bits-in-byte.js @@ -1,6 +1,8 @@ // Copyright (c) 2004 by Arthur Langereis (arthur_ext at domain xfinitegames, tld com) +var result = 0; + // 1 op = 2 assigns, 16 compare/branches, 8 ANDs, (0-8) ADDs, 8 SHLs // O(n) function bitsinbyte(b) { @@ -14,8 +16,10 @@ return c; function TimeFunc(func) { var x, y, t; +var sum = 0; for(var x=0; x<350; x++) -for(var y=0; y<256; y++) func(y); +for(var y=0; y<256; y++) sum += func(y); +return sum; } -TimeFunc(bitsinbyte); +result = TimeFunc(bitsinbyte); diff --git a/PerformanceTests/SunSpider/tests/sunspider-1.0/bitops-bitwise-and.js b/PerformanceTests/SunSpider/tests/sunspider-1.0/bitops-bitwise-and.js index 7c80e696d933..b274f77a3d92 100644 --- a/PerformanceTests/SunSpider/tests/sunspider-1.0/bitops-bitwise-and.js +++ b/PerformanceTests/SunSpider/tests/sunspider-1.0/bitops-bitwise-and.js @@ -26,3 +26,5 @@ bitwiseAndValue = 4294967296; for (var i = 0; i < 600000; i++) bitwiseAndValue = bitwiseAndValue & i; + +var result = butwiseAndValue; diff --git a/PerformanceTests/SunSpider/tests/sunspider-1.0/bitops-nsieve-bits.js b/PerformanceTests/SunSpider/tests/sunspider-1.0/bitops-nsieve-bits.js index 6ef0ddb11b03..a9f2d221b08f 100644 --- a/PerformanceTests/SunSpider/tests/sunspider-1.0/bitops-nsieve-bits.js +++ b/PerformanceTests/SunSpider/tests/sunspider-1.0/bitops-nsieve-bits.js @@ -27,6 +27,7 @@ function sieve() { var isPrime = new Array((10000<>5); primes(isPrime, i); } + return isPrime; } -sieve(); +var result = sieve(); -- 2.36.0