embryo speedups...

this makes embryo just about the fastest "scripting vm" around - unless you
tie yourself to a particular cpu and add a jit for that cpu (which embryo
doesnt have).

 bash:                  4681.700 (estimate - ran only 1/100th of loop)
 python:                  38.193
 ruby:                    21.015
 perl:                    18.925
 java (gij-3.4) (no jit):  2.484
 embryo:                   1.041
 java (kaffe)      (jit):  0.176
 c:                        0.157

notice emrbyo is more than double the speed of the java vm. this is all
portable code - no jit tied to 1 cpu. we can add that later per cpu - but for
a vm/scripting solution thats cross-platform and runs anwyeher on 32, 64bit
cpus, ppc, x86, x86-64, alpha, arm, sparc, mips etc. it's pretty damn good.

yes this test is VERY naieve and simple and only tests a subset - but it
tests the general execution and interpreting engine, being able to make
logical decisions, interpret code and do math operations. we should do a more
comprehensive test, but this is pretty good for a simple one.

here's the source used:

bash:
#!/bin/bash
I=1
while [ $I -lt 1000000 ]; do
  let I++
done

python:
i = 1
while i < 100000000:
    i = i + 1

ruby:
1.upto(100000000) { }

perl:
#!/usr/bin/perl
for ($i = 1; $i < 100000000; $i++) {
}

java:
public class loop {
   public static void main(String[] args) {
      int i;
      for (i = 1; i < 100000000; i++) { }
   }
}

embryo:
main() {
   new i;
   for (i = 1; i < 100000000; i++) { }
}

c:
main() {
   int i;
   for (i = 1; i < 100000000; i++);
}


SVN revision: 11880
This commit is contained in:
Carsten Haitzler 2004-10-14 04:17:20 +00:00
parent 0fdc3f087a
commit 9a09666229
1 changed files with 923 additions and 716 deletions

File diff suppressed because it is too large Load Diff