Browse Source

Merge branch 'perf-indent-trivia'

pull/156/head
Sami Vaarala 10 years ago
parent
commit
2cda81e56d
  1. 12
      perf-testcases/test-call-basic.pl
  2. 12
      perf-testcases/test-call-basic.rb
  3. 12
      perf-testcases/test-fib.pl
  4. 10
      perf-testcases/test-fib.rb

12
perf-testcases/test-call-basic.pl

@ -1,12 +1,12 @@
sub test {
my $i;
my $i;
sub f { return; }
sub f { return; }
$i = 0;
for ($i = 0; $i < 1e8; $i++) {
f();
}
$i = 0;
for ($i = 0; $i < 1e8; $i++) {
f();
}
}
test();

12
perf-testcases/test-call-basic.rb

@ -1,11 +1,11 @@
def test()
def f() return end
def f() return end
i = 0
while i < 1e8 do
f()
i += 1
end
i = 0
while i < 1e8 do
f()
i += 1
end
end
test()

12
perf-testcases/test-fib.pl

@ -1,9 +1,9 @@
sub fib {
my $n = shift;
if ($n <= 1) {
return $n;
} else {
return fib($n - 2) + fib($n - 1);
}
my $n = shift;
if ($n <= 1) {
return $n;
} else {
return fib($n - 2) + fib($n - 1);
}
}
print fib(35) . "\n";

10
perf-testcases/test-fib.rb

@ -1,9 +1,9 @@
def fib(n)
if n <= 1 then
return n
else
return fib(n - 2) + fib(n - 1)
end
if n <= 1 then
return n
else
return fib(n - 2) + fib(n - 1)
end
end
print(fib(35).to_s + "\n")

Loading…
Cancel
Save