tests: update benchs*.nit to have a common default time and an non-linear grow
authorJean Privat <jean@pryen.org>
Fri, 17 Apr 2015 06:47:22 +0000 (13:47 +0700)
committerJean Privat <jean@pryen.org>
Fri, 17 Apr 2015 08:11:17 +0000 (15:11 +0700)
Signed-off-by: Jean Privat <jean@pryen.org>

30 files changed:
tests/bench_421.nit
tests/bench_add_all.nit
tests/bench_complex_sort.nit
tests/bench_fib.nit
tests/bench_int_range_iterator.nit
tests/bench_netsim.nit
tests/bench_nsieve_bool.nit
tests/bench_send.nit
tests/bench_send2.nit
tests/bench_strfib.nit
tests/bench_string_append.nit
tests/bench_string_super.nit
tests/bench_string_tos.nit
tests/bench_tak.nit
tests/sav/bench_421.res
tests/sav/bench_add_all.res
tests/sav/bench_fib.res
tests/sav/bench_int_range_iterator.res
tests/sav/bench_netsim.res
tests/sav/bench_nsieve_bool.res
tests/sav/bench_strfib.res
tests/sav/bench_string_append.res
tests/sav/bench_string_append_alt1.res
tests/sav/bench_string_super.res
tests/sav/bench_string_tos.res
tests/sav/test_hash.res
tests/sav/test_map.res
tests/sav/test_mem.res
tests/test_map.nit
tests/test_mem.nit

index b87347c..a868768 100644 (file)
@@ -29,7 +29,7 @@ do
        return steps
 end
 
-var n = 10
+var n = 456
 if not args.is_empty then
        n = args.first.to_i
 end
index 733ac9b..0c9bc5e 100644 (file)
 
 # Performance test for Array::add_all
 
-import standard::collection
+var n = 10
+if args.not_empty then n = args.first.to_i
+
+var nn = 1.lshift(n)
 
 var a = new Array[Numeric]
 var b = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
-for i in 10000.times do
+for i in nn.times do
        a.add_all b
 end
 
 var c = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0]
-for i in 10000.times do
+for i in nn.times do
        a.add_all c
 end
 
index 2eef2cb..e05cb45 100644 (file)
@@ -111,7 +111,7 @@ do
        end
 end
 
-var n = 100
+var n = 20
 
 if not args.is_empty then
        n = args.first.to_i
index 69dc371..8c7d4da 100644 (file)
@@ -30,7 +30,7 @@ redef class Int
        end
 end
 
-var n = 10
+var n = 20
 if not args.is_empty then
        n = args.first.to_i
 end
index 17f24d2..3d906f0 100644 (file)
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-var nb = 5
+var nb = 25
 if not args.is_empty then nb = args.first.to_i
 
 var cpt = 0
index f784635..0e13e59 100644 (file)
@@ -267,11 +267,11 @@ e1.attach(a1)
 b1.start
 b2.start
 
-var nb = 100000
+var nb = 10
 if not args.is_empty then
        nb = args.first.to_i
 end
 
-s.run_for(nb)
+s.run_for(1.lshift(nb))
 print(c1.count)
 
index 36da71a..634e3cb 100644 (file)
@@ -38,11 +38,11 @@ end
 
 fun test(n: Int)
 do
-       var m = 10000.lshift(n)
+       var m = 1000.lshift(n)
        print("Primes up to {m} {nsieve(m)}")
 end
 
-var n = 2
+var n = 3
 if args.length == 1 then
        n = args.first.to_i
 end
index 03218dc..5659ee1 100644 (file)
@@ -97,7 +97,11 @@ b.val = 1
 c.val = 2
 d.val = 3
 var i = 0
-while i < 100000 do
+
+var n = 10
+if args.not_empty then n = args.first.to_i
+
+while i < 1.lshift(n) do
        a.hop(b, c, d)
        i = i + 1
 end
index e296465..3e8853e 100644 (file)
@@ -53,6 +53,9 @@ class F
 
 end
 
+var n = 10
+if args.not_empty then n = args.first.to_i
+
 var nb = 60
 var a = new Array[Object].with_capacity(nb)
 for i in [0..(nb/6)[ do
@@ -63,7 +66,7 @@ for i in [0..(nb/6)[ do
        a[i*6+4] = new E
        a[i*6+5] = new F
 end
-for i in [0..1000000[ do
+for i in [0..1.lshift(n)[ do
        for j in [0..nb[ do
                a[j].foo
        end
index 2357686..f65d436 100644 (file)
@@ -32,7 +32,7 @@ if args.has("-q") then
        args.remove("-q")
 end
 
-var n = 5
+var n = 15
 if args.length > 0 then n = args.first.to_i
 var res = strfib(n)
 
index c99dc83..df00536 100644 (file)
@@ -17,7 +17,7 @@
 #alt1 import standard
 #alt1 import standard::ropes
 
-var n = 7
+var n = 4
 if not args.is_empty then
        n = args.first.to_i
 end
index ad27304..c78f448 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+var n = 10
+if args.not_empty then n = args.first.to_i
+
 var s = "*"
-var i = 0
-while i < 8 do
+var i = 1
+while i < n do
        s = "Je dis «{s}» et redis «{s}» et trois fois de plus : «{s}{s}{s}».\n"
        i = i + 1
 end
index 1d59691..dbc8ac9 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+var n = 10
+if args.not_empty then n = args.first.to_i
+
 var s = "*"
 var i = 0
-while i < 8 do
+while i < n do
        s = ["Je dis «", s, "» et redis «", s, "» et trois fois de plus : «", s, s, s, "».\n"].to_s
        i = i + 1
 end
index d5be5e8..ac128d3 100644 (file)
@@ -27,4 +27,7 @@ do
        end
 end
 
-print(tak(37,12,6))
+var n = 17
+if args.not_empty then n = args.first.to_i
+
+print(tak(n,12,6))
index 5079bf7..4e2232f 100644 (file)
@@ -1 +1 @@
-9: 19
+327: 143
index d9e91fa..134debf 100644 (file)
@@ -1,3 +1,3 @@
-Primes up to 40000 4203
-Primes up to 20000 2262
-Primes up to 10000 1229
+Primes up to 8000 1007
+Primes up to 4000 550
+Primes up to 2000 303
index 4e58388..aa267d1 100644 (file)
@@ -1 +1 @@
-((()(()))((())(()(()))))
+(((((((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(()))))))((((())(()(())))((()(()))((())(()(())))))(((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(()))))))))(((((())(()(())))((()(()))((())(()(())))))(((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(())))))))((((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(()))))))((((())(()(())))((()(()))((())(()(())))))(((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(()))))))))))((((((())(()(())))((()(()))((())(()(())))))(((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(())))))))((((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(()))))))((((())(()(())))((()(()))((())(()(())))))(((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(())))))))))(((((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(()))))))((((())(()(())))((()(()))((())(()(())))))(((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(()))))))))(((((())(()(())))((()(()))((())(()(())))))(((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(())))))))((((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(()))))))((((())(()(())))((()(()))((())(()(())))))(((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(()))))))))))))(((((((())(()(())))((()(()))((())(()(())))))(((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(())))))))((((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(()))))))((((())(()(())))((()(()))((())(()(())))))(((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(())))))))))(((((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(()))))))((((())(()(())))((()(()))((())(()(())))))(((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(()))))))))(((((())(()(())))((()(()))((())(()(())))))(((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(())))))))((((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(()))))))((((())(()(())))((()(()))((())(()(())))))(((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(())))))))))))((((((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(()))))))((((())(()(())))((()(()))((())(()(())))))(((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(()))))))))(((((())(()(())))((()(()))((())(()(())))))(((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(())))))))((((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(()))))))((((())(()(())))((()(()))((())(()(())))))(((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(()))))))))))((((((())(()(())))((()(()))((())(()(())))))(((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(())))))))((((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(()))))))((((())(()(())))((()(()))((())(()(())))))(((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(())))))))))(((((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(()))))))((((())(()(())))((()(()))((())(()(())))))(((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(()))))))))(((((())(()(())))((()(()))((())(()(())))))(((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(())))))))((((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(()))))))((((())(()(())))((()(()))((())(()(())))))(((()(()))((())(()(()))))(((())(()(())))((()(()))((())(()(()))))))))))))))
index dc72c30..5cbab16 100644 (file)
@@ -11,8 +11,8 @@ true
 2
 0
 * test 2 *
-1000
-334
+100
+34
 * test 3 *
 * start:
 true
index dabb78b..48cdded 100644 (file)
@@ -10,8 +10,8 @@ true
 2
 0
 * test 2 *
-1000
-334
+100
+34
 * test 3 *
 * start:
 true
index a9be79e..2a5b99a 100644 (file)
@@ -1 +1 @@
-1234567891011121314151617181920212223
+12345678910
index c5b9eea..8e147f7 100644 (file)
@@ -40,7 +40,7 @@ end
 fun test2(h: Map[Int, Int])
 do
        print("* test 2 *")
-       var nb = 999
+       var nb = 99
        
        var i = 0
        while i <= nb do
index 9487e82..dc9d167 100644 (file)
@@ -27,4 +27,7 @@ fun foo(n: Int): List[Int]
        return a
     end
 
-print(foo(23))
+var n = 10
+if args.not_empty then n = args.first.to_i
+
+print(foo(n))