Browse Source

Perf tests: const load, continue fast/slow, mandel

pull/380/head
Sami Vaarala 9 years ago
parent
commit
99ccab941b
  1. 44
      tests/perf/test-assign-add.js
  2. 39
      tests/perf/test-assign-add.lua
  3. 41
      tests/perf/test-assign-add.pl
  4. 39
      tests/perf/test-assign-add.py
  5. 42
      tests/perf/test-assign-add.rb
  6. 44
      tests/perf/test-assign-addto.js
  7. 38
      tests/perf/test-assign-addto.lua
  8. 41
      tests/perf/test-assign-addto.pl
  9. 38
      tests/perf/test-assign-addto.py
  10. 41
      tests/perf/test-assign-addto.rb
  11. 127
      tests/perf/test-assign-const-int.js
  12. 117
      tests/perf/test-assign-const-int.lua
  13. 119
      tests/perf/test-assign-const-int.pl
  14. 116
      tests/perf/test-assign-const-int.py
  15. 118
      tests/perf/test-assign-const-int.rb
  16. 0
      tests/perf/test-assign-const.js
  17. 0
      tests/perf/test-assign-const.lua
  18. 1
      tests/perf/test-assign-const.pl
  19. 0
      tests/perf/test-assign-const.py
  20. 0
      tests/perf/test-assign-const.rb
  21. 127
      tests/perf/test-assign-literal.js
  22. 117
      tests/perf/test-assign-literal.lua
  23. 116
      tests/perf/test-assign-literal.py
  24. 118
      tests/perf/test-assign-literal.rb
  25. 0
      tests/perf/test-assign-reg.js
  26. 0
      tests/perf/test-assign-reg.lua
  27. 0
      tests/perf/test-assign-reg.py
  28. 0
      tests/perf/test-assign-reg.rb
  29. 15
      tests/perf/test-continue-fast.js
  30. 18
      tests/perf/test-continue-slow.js
  31. 43
      tests/perf/test-mandel.js

44
tests/perf/test-assign-add.js

@ -0,0 +1,44 @@
function test() {
var i;
var t;
var a = 10, b = 20;
for (i = 0; i < 1e7; i++) {
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b;
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b;
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b;
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b;
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b;
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b;
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b;
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b;
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b;
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b;
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b;
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b;
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b;
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b;
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b;
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b;
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b;
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b;
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b;
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b;
}
}
try {
test();
} catch (e) {
print(e.stack || e);
throw e;
}

39
tests/perf/test-assign-add.lua

@ -0,0 +1,39 @@
local function test()
local t
local a = 10
local b = 20
for i=1,1e7 do
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
end
end
test()

41
tests/perf/test-assign-add.pl

@ -0,0 +1,41 @@
sub test {
my $i;
my $t;
my $a = 10;
my $b = 20;
$i = 0;
for ($i = 0; $i < 1e7; $i++) {
$t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b;
$t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b;
$t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b;
$t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b;
$t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b;
$t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b;
$t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b;
$t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b;
$t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b;
$t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b;
$t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b;
$t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b;
$t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b;
$t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b;
$t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b;
$t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b;
$t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b;
$t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b;
$t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b;
$t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b; $t = $a + $b;
}
}
test();

39
tests/perf/test-assign-add.py

@ -0,0 +1,39 @@
def test():
a = 10
b = 20
i = 0
while i < 1e7:
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
i += 1
test()

42
tests/perf/test-assign-add.rb

@ -0,0 +1,42 @@
def test()
t = 0
a = 10
b = 20
i = 0
while i < 1e7 do
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
t = a + b; t = a + b; t = a + b; t = a + b; t = a + b
i += 1
end
end
test()

44
tests/perf/test-assign-addto.js

@ -0,0 +1,44 @@
function test() {
var i;
var t;
var a = 10;
for (i = 0; i < 1e7; i++) {
t += a; t += a; t += a; t += a; t += a;
t += a; t += a; t += a; t += a; t += a;
t += a; t += a; t += a; t += a; t += a;
t += a; t += a; t += a; t += a; t += a;
t += a; t += a; t += a; t += a; t += a;
t += a; t += a; t += a; t += a; t += a;
t += a; t += a; t += a; t += a; t += a;
t += a; t += a; t += a; t += a; t += a;
t += a; t += a; t += a; t += a; t += a;
t += a; t += a; t += a; t += a; t += a;
t += a; t += a; t += a; t += a; t += a;
t += a; t += a; t += a; t += a; t += a;
t += a; t += a; t += a; t += a; t += a;
t += a; t += a; t += a; t += a; t += a;
t += a; t += a; t += a; t += a; t += a;
t += a; t += a; t += a; t += a; t += a;
t += a; t += a; t += a; t += a; t += a;
t += a; t += a; t += a; t += a; t += a;
t += a; t += a; t += a; t += a; t += a;
t += a; t += a; t += a; t += a; t += a;
}
}
try {
test();
} catch (e) {
print(e.stack || e);
throw e;
}

38
tests/perf/test-assign-addto.lua

@ -0,0 +1,38 @@
local function test()
local t
local a = 10
for i=1,1e7 do
t = t + a; t = t + a; t = t + a; t = t + a; t = t + a
t = t + a; t = t + a; t = t + a; t = t + a; t = t + a
t = t + a; t = t + a; t = t + a; t = t + a; t = t + a
t = t + a; t = t + a; t = t + a; t = t + a; t = t + a
t = t + a; t = t + a; t = t + a; t = t + a; t = t + a
t = t + a; t = t + a; t = t + a; t = t + a; t = t + a
t = t + a; t = t + a; t = t + a; t = t + a; t = t + a
t = t + a; t = t + a; t = t + a; t = t + a; t = t + a
t = t + a; t = t + a; t = t + a; t = t + a; t = t + a
t = t + a; t = t + a; t = t + a; t = t + a; t = t + a
t = t + a; t = t + a; t = t + a; t = t + a; t = t + a
t = t + a; t = t + a; t = t + a; t = t + a; t = t + a
t = t + a; t = t + a; t = t + a; t = t + a; t = t + a
t = t + a; t = t + a; t = t + a; t = t + a; t = t + a
t = t + a; t = t + a; t = t + a; t = t + a; t = t + a
t = t + a; t = t + a; t = t + a; t = t + a; t = t + a
t = t + a; t = t + a; t = t + a; t = t + a; t = t + a
t = t + a; t = t + a; t = t + a; t = t + a; t = t + a
t = t + a; t = t + a; t = t + a; t = t + a; t = t + a
t = t + a; t = t + a; t = t + a; t = t + a; t = t + a
end
end
test()

41
tests/perf/test-assign-addto.pl

@ -0,0 +1,41 @@
sub test {
my $i;
my $t;
my $a = 10;
my $b = 20;
$i = 0;
for ($i = 0; $i < 1e7; $i++) {
$t += $a; $t += $a; $t += $a; $t += $a; $t += $a;
$t += $a; $t += $a; $t += $a; $t += $a; $t += $a;
$t += $a; $t += $a; $t += $a; $t += $a; $t += $a;
$t += $a; $t += $a; $t += $a; $t += $a; $t += $a;
$t += $a; $t += $a; $t += $a; $t += $a; $t += $a;
$t += $a; $t += $a; $t += $a; $t += $a; $t += $a;
$t += $a; $t += $a; $t += $a; $t += $a; $t += $a;
$t += $a; $t += $a; $t += $a; $t += $a; $t += $a;
$t += $a; $t += $a; $t += $a; $t += $a; $t += $a;
$t += $a; $t += $a; $t += $a; $t += $a; $t += $a;
$t += $a; $t += $a; $t += $a; $t += $a; $t += $a;
$t += $a; $t += $a; $t += $a; $t += $a; $t += $a;
$t += $a; $t += $a; $t += $a; $t += $a; $t += $a;
$t += $a; $t += $a; $t += $a; $t += $a; $t += $a;
$t += $a; $t += $a; $t += $a; $t += $a; $t += $a;
$t += $a; $t += $a; $t += $a; $t += $a; $t += $a;
$t += $a; $t += $a; $t += $a; $t += $a; $t += $a;
$t += $a; $t += $a; $t += $a; $t += $a; $t += $a;
$t += $a; $t += $a; $t += $a; $t += $a; $t += $a;
$t += $a; $t += $a; $t += $a; $t += $a; $t += $a;
}
}
test();

38
tests/perf/test-assign-addto.py

@ -0,0 +1,38 @@
def test():
a = 10
i = 0
while i < 1e7:
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
i += 1
test()

41
tests/perf/test-assign-addto.rb

@ -0,0 +1,41 @@
def test()
t = 0
a = 10
i = 0
while i < 1e7 do
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
i += 1
end
end
test()

127
tests/perf/test-assign-const-int.js

@ -0,0 +1,127 @@
/*
* Loading integer constant to register.
*/
function test() {
var i;
var t;
for (i = 0; i < 1e7; i++) {
t = 1230;
t = 1231;
t = 1232;
t = 1233;
t = 1234;
t = 1235;
t = 1236;
t = 1237;
t = 1238;
t = 1239;
t = 1230;
t = 1231;
t = 1232;
t = 1233;
t = 1234;
t = 1235;
t = 1236;
t = 1237;
t = 1238;
t = 1239;
t = 1230;
t = 1231;
t = 1232;
t = 1233;
t = 1234;
t = 1235;
t = 1236;
t = 1237;
t = 1238;
t = 1239;
t = 1230;
t = 1231;
t = 1232;
t = 1233;
t = 1234;
t = 1235;
t = 1236;
t = 1237;
t = 1238;
t = 1239;
t = 1230;
t = 1231;
t = 1232;
t = 1233;
t = 1234;
t = 1235;
t = 1236;
t = 1237;
t = 1238;
t = 1239;
t = 1230;
t = 1231;
t = 1232;
t = 1233;
t = 1234;
t = 1235;
t = 1236;
t = 1237;
t = 1238;
t = 1239;
t = 1230;
t = 1231;
t = 1232;
t = 1233;
t = 1234;
t = 1235;
t = 1236;
t = 1237;
t = 1238;
t = 1239;
t = 1230;
t = 1231;
t = 1232;
t = 1233;
t = 1234;
t = 1235;
t = 1236;
t = 1237;
t = 1238;
t = 1239;
t = 1230;
t = 1231;
t = 1232;
t = 1233;
t = 1234;
t = 1235;
t = 1236;
t = 1237;
t = 1238;
t = 1239;
t = 1230;
t = 1231;
t = 1232;
t = 1233;
t = 1234;
t = 1235;
t = 1236;
t = 1237;
t = 1238;
t = 1239;
}
}
try {
test();
} catch (e) {
print(e.stack || e);
throw e;
}

117
tests/perf/test-assign-const-int.lua

@ -0,0 +1,117 @@
local function test()
local t
for i=1,1e7 do
t = 1230
t = 1231
t = 1232
t = 1233
t = 1234
t = 1235
t = 1236
t = 1237
t = 1238
t = 1239
t = 1230
t = 1231
t = 1232
t = 1233
t = 1234
t = 1235
t = 1236
t = 1237
t = 1238
t = 1239
t = 1230
t = 1231
t = 1232
t = 1233
t = 1234
t = 1235
t = 1236
t = 1237
t = 1238
t = 1239
t = 1230
t = 1231
t = 1232
t = 1233
t = 1234
t = 1235
t = 1236
t = 1237
t = 1238
t = 1239
t = 1230
t = 1231
t = 1232
t = 1233
t = 1234
t = 1235
t = 1236
t = 1237
t = 1238
t = 1239
t = 1230
t = 1231
t = 1232
t = 1233
t = 1234
t = 1235
t = 1236
t = 1237
t = 1238
t = 1239
t = 1230
t = 1231
t = 1232
t = 1233
t = 1234
t = 1235
t = 1236
t = 1237
t = 1238
t = 1239
t = 1230
t = 1231
t = 1232
t = 1233
t = 1234
t = 1235
t = 1236
t = 1237
t = 1238
t = 1239
t = 1230
t = 1231
t = 1232
t = 1233
t = 1234
t = 1235
t = 1236
t = 1237
t = 1238
t = 1239
t = 1230
t = 1231
t = 1232
t = 1233
t = 1234
t = 1235
t = 1236
t = 1237
t = 1238
t = 1239
end
end
test()

119
tests/perf/test-assign-const-int.pl

@ -0,0 +1,119 @@
sub test {
my $i;
my $t;
$i = 0;
for ($i = 0; $i < 1e7; $i++) {
$t = 1230;
$t = 1231;
$t = 1232;
$t = 1233;
$t = 1234;
$t = 1235;
$t = 1236;
$t = 1237;
$t = 1238;
$t = 1239;
$t = 1230;
$t = 1231;
$t = 1232;
$t = 1233;
$t = 1234;
$t = 1235;
$t = 1236;
$t = 1237;
$t = 1238;
$t = 1239;
$t = 1230;
$t = 1231;
$t = 1232;
$t = 1233;
$t = 1234;
$t = 1235;
$t = 1236;
$t = 1237;
$t = 1238;
$t = 1239;
$t = 1230;
$t = 1231;
$t = 1232;
$t = 1233;
$t = 1234;
$t = 1235;
$t = 1236;
$t = 1237;
$t = 1238;
$t = 1239;
$t = 1230;
$t = 1231;
$t = 1232;
$t = 1233;
$t = 1234;
$t = 1235;
$t = 1236;
$t = 1237;
$t = 1238;
$t = 1239;
$t = 1230;
$t = 1231;
$t = 1232;
$t = 1233;
$t = 1234;
$t = 1235;
$t = 1236;
$t = 1237;
$t = 1238;
$t = 1239;
$t = 1230;
$t = 1231;
$t = 1232;
$t = 1233;
$t = 1234;
$t = 1235;
$t = 1236;
$t = 1237;
$t = 1238;
$t = 1239;
$t = 1230;
$t = 1231;
$t = 1232;
$t = 1233;
$t = 1234;
$t = 1235;
$t = 1236;
$t = 1237;
$t = 1238;
$t = 1239;
$t = 1230;
$t = 1231;
$t = 1232;
$t = 1233;
$t = 1234;
$t = 1235;
$t = 1236;
$t = 1237;
$t = 1238;
$t = 1239;
$t = 1230;
$t = 1231;
$t = 1232;
$t = 1233;
$t = 1234;
$t = 1235;
$t = 1236;
$t = 1237;
$t = 1238;
$t = 1239;
}
}
test();

116
tests/perf/test-assign-const-int.py

@ -0,0 +1,116 @@
def test():
i = 0
while i < 1e7:
t = 1230
t = 1231
t = 1232
t = 1233
t = 1234
t = 1235
t = 1236
t = 1237
t = 1238
t = 1239
t = 1230
t = 1231
t = 1232
t = 1233
t = 1234
t = 1235
t = 1236
t = 1237
t = 1238
t = 1239
t = 1230
t = 1231
t = 1232
t = 1233
t = 1234
t = 1235
t = 1236
t = 1237
t = 1238
t = 1239
t = 1230
t = 1231
t = 1232
t = 1233
t = 1234
t = 1235
t = 1236
t = 1237
t = 1238
t = 1239
t = 1230
t = 1231
t = 1232
t = 1233
t = 1234
t = 1235
t = 1236
t = 1237
t = 1238
t = 1239
t = 1230
t = 1231
t = 1232
t = 1233
t = 1234
t = 1235
t = 1236
t = 1237
t = 1238
t = 1239
t = 1230
t = 1231
t = 1232
t = 1233
t = 1234
t = 1235
t = 1236
t = 1237
t = 1238
t = 1239
t = 1230
t = 1231
t = 1232
t = 1233
t = 1234
t = 1235
t = 1236
t = 1237
t = 1238
t = 1239
t = 1230
t = 1231
t = 1232
t = 1233
t = 1234
t = 1235
t = 1236
t = 1237
t = 1238
t = 1239
t = 1230
t = 1231
t = 1232
t = 1233
t = 1234
t = 1235
t = 1236
t = 1237
t = 1238
t = 1239
i += 1
test()

118
tests/perf/test-assign-const-int.rb

@ -0,0 +1,118 @@
def test()
i = 0
while i < 1e7 do
t = 1230
t = 1231
t = 1232
t = 1233
t = 1234
t = 1235
t = 1236
t = 1237
t = 1238
t = 1239
t = 1230
t = 1231
t = 1232
t = 1233
t = 1234
t = 1235
t = 1236
t = 1237
t = 1238
t = 1239
t = 1230
t = 1231
t = 1232
t = 1233
t = 1234
t = 1235
t = 1236
t = 1237
t = 1238
t = 1239
t = 1230
t = 1231
t = 1232
t = 1233
t = 1234
t = 1235
t = 1236
t = 1237
t = 1238
t = 1239
t = 1230
t = 1231
t = 1232
t = 1233
t = 1234
t = 1235
t = 1236
t = 1237
t = 1238
t = 1239
t = 1230
t = 1231
t = 1232
t = 1233
t = 1234
t = 1235
t = 1236
t = 1237
t = 1238
t = 1239
t = 1230
t = 1231
t = 1232
t = 1233
t = 1234
t = 1235
t = 1236
t = 1237
t = 1238
t = 1239
t = 1230
t = 1231
t = 1232
t = 1233
t = 1234
t = 1235
t = 1236
t = 1237
t = 1238
t = 1239
t = 1230
t = 1231
t = 1232
t = 1233
t = 1234
t = 1235
t = 1236
t = 1237
t = 1238
t = 1239
t = 1230
t = 1231
t = 1232
t = 1233
t = 1234
t = 1235
t = 1236
t = 1237
t = 1238
t = 1239
i += 1
end
end
test()

0
tests/perf/test-const-load.js → tests/perf/test-assign-const.js

0
tests/perf/test-const-load.lua → tests/perf/test-assign-const.lua

1
tests/perf/test-const-load.pl → tests/perf/test-assign-const.pl

@ -1,5 +1,6 @@
sub test {
my $i;
my $t;
$i = 0;
for ($i = 0; $i < 1e7; $i++) {

0
tests/perf/test-const-load.py → tests/perf/test-assign-const.py

0
tests/perf/test-const-load.rb → tests/perf/test-assign-const.rb

127
tests/perf/test-assign-literal.js

@ -0,0 +1,127 @@
/*
* Loading a mix of plain literals to register.
*/
function test() {
var i;
var t;
for (i = 0; i < 1e7; i++) {
t = true;
t = false;
t = void null;
t = null;
t = this;
t = true;
t = false;
t = void null;
t = null;
t = this;
t = true;
t = false;
t = void null;
t = null;
t = this;
t = true;
t = false;
t = void null;
t = null;
t = this;
t = true;
t = false;
t = void null;
t = null;
t = this;
t = true;
t = false;
t = void null;
t = null;
t = this;
t = true;
t = false;
t = void null;
t = null;
t = this;
t = true;
t = false;
t = void null;
t = null;
t = this;
t = true;
t = false;
t = void null;
t = null;
t = this;
t = true;
t = false;
t = void null;
t = null;
t = this;
t = true;
t = false;
t = void null;
t = null;
t = this;
t = true;
t = false;
t = void null;
t = null;
t = this;
t = true;
t = false;
t = void null;
t = null;
t = this;
t = true;
t = false;
t = void null;
t = null;
t = this;
t = true;
t = false;
t = void null;
t = null;
t = this;
t = true;
t = false;
t = void null;
t = null;
t = this;
t = true;
t = false;
t = void null;
t = null;
t = this;
t = true;
t = false;
t = void null;
t = null;
t = this;
t = true;
t = false;
t = void null;
t = null;
t = this;
t = true;
t = false;
t = void null;
t = null;
t = this;
}
}
try {
test();
} catch (e) {
print(e.stack || e);
throw e;
}

117
tests/perf/test-assign-literal.lua

@ -0,0 +1,117 @@
local function test()
local t
for i=1,1e7 do
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
end
end
test()

116
tests/perf/test-assign-literal.py

@ -0,0 +1,116 @@
def test():
i = 0
while i < 1e7:
t = True
t = False
t = None
t = True
t = False
t = None
t = True
t = False
t = None
t = True
t = True
t = False
t = None
t = True
t = False
t = None
t = True
t = False
t = None
t = True
t = True
t = False
t = None
t = True
t = False
t = None
t = True
t = False
t = None
t = True
t = True
t = False
t = None
t = True
t = False
t = None
t = True
t = False
t = None
t = True
t = True
t = False
t = None
t = True
t = False
t = None
t = True
t = False
t = None
t = True
t = True
t = False
t = None
t = True
t = False
t = None
t = True
t = False
t = None
t = True
t = True
t = False
t = None
t = True
t = False
t = None
t = True
t = False
t = None
t = True
t = True
t = False
t = None
t = True
t = False
t = None
t = True
t = False
t = None
t = True
t = True
t = False
t = None
t = True
t = False
t = None
t = True
t = False
t = None
t = True
t = True
t = False
t = None
t = True
t = False
t = None
t = True
t = False
t = None
t = True
i += 1
test()

118
tests/perf/test-assign-literal.rb

@ -0,0 +1,118 @@
def test()
i = 0
while i < 1e7 do
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
t = false
t = nil
t = true
i += 1
end
end
test()

0
tests/perf/test-reg-load.js → tests/perf/test-assign-reg.js

0
tests/perf/test-reg-load.lua → tests/perf/test-assign-reg.lua

0
tests/perf/test-reg-load.py → tests/perf/test-assign-reg.py

0
tests/perf/test-reg-load.rb → tests/perf/test-assign-reg.rb

15
tests/perf/test-continue-fast.js

@ -0,0 +1,15 @@
function test() {
var i;
for (i = 0; i < 1e8; i++) {
do {
continue;
} while (0);
}
}
try {
test();
} catch (e) {
print(e.stack || e);
throw e;
}

18
tests/perf/test-continue-slow.js

@ -0,0 +1,18 @@
function test() {
var i;
for (i = 0; i < 1e8; i++) {
do {
try {
continue;
} finally {
}
} while (0);
}
}
try {
test();
} catch (e) {
print(e.stack || e);
throw e;
}

43
tests/perf/test-mandel.js

@ -0,0 +1,43 @@
if (typeof print !== 'function') { print = console.log; }
function mandel() {
var w = 76, h = 28, iter = 100000;
var i, j, k, c;
var x0, y0, xx, yy, xx2, yy2;
var line;
for (i = 0; i < h; i++) {
y0 = (i / h) * 2.5 - 1.25;
for (j = 0, line = []; j < w; j++) {
x0 = (j / w) * 3.0 - 2.0;
for (k = 0, xx = 0, yy = 0, c = '#'; k < iter; k++) {
xx2 = xx*xx; yy2 = yy*yy;
if (xx2 + yy2 < 4.0) {
yy = 2*xx*yy + y0;
xx = xx2 - yy2 + x0;
} else {
/* xx^2 + yy^2 >= 4.0 */
if (k < 3) { c = '.'; }
else if (k < 5) { c = ','; }
else if (k < 10) { c = '-'; }
else { c = '='; }
break;
}
}
line.push(c);
}
print(line.join(''));
}
}
try {
mandel();
} catch (e) {
print(e.stack || e);
throw e;
}
Loading…
Cancel
Save