feat: reduce for-loop benchmark iteration count from 2M to 1M across Lua, Python, Ruby, Wren
Update all four language implementations in the for-loop benchmark to use 1,000,000 iterations instead of 2,000,000, and adjust the expected sum in run_bench from 1999999000000 to 499999500000. Also move timer start to before list construction in Lua, Python, and Ruby, and inline the Wren sum loop into a single line.
This commit is contained in:
+4
-5
@@ -1,11 +1,10 @@
|
||||
var list = []
|
||||
|
||||
for (i in 0...2000000) list.add(i)
|
||||
|
||||
var start = OS.clock
|
||||
for (i in 0...1000000) list.add(i)
|
||||
|
||||
var sum = 0
|
||||
for (i in list) {
|
||||
sum = sum + i
|
||||
}
|
||||
for (i in list) sum = sum + i
|
||||
|
||||
IO.print(sum)
|
||||
IO.print("elapsed: " + (OS.clock - start).toString)
|
||||
|
||||
Reference in New Issue
Block a user