Re: Idle musings on doing E over again
Kevin Reid <kpreid-M/[email protected]> Tue, 2 Oct 2012 07:36:20 -0700
| Newsgroups | gmane.comp.lang.e.general |
|---|---|
| Message-ID | <[email protected]> |
On Oct 2, 2012, at 4:06, Thomas Leonard wrote: > On 2 October 2012 03:16, Bill Frantz <[email protected]> wrote: > I profiled E's startup a while back, but there > was nothing obviously the problem, just many little things. > [...] > E's startup time is a lot worse than Java's (even though Java is > indeed far too slow): > > $ time python hello.py > python hello.py 0.02s user 0.00s system 84% cpu 0.024 total > > $ time java Hello > java Hello 0.06s user 0.02s system 98% cpu 0.082 total > > $ time rune hello.e > rune hello.e 9.23s user 0.34s system 200% cpu 4.785 total My hypothesis, which I don't recall the origin of and so may or may not be based on actual analysis, is that most of this time is spent in • evaluating static initializers and global tables in E's Java code (which includes things like SafeJ tables) • parsing/expanding/evaluating one-off E code These could be improved by figuring out how to 'compile' the E implementation better, i.e. precompute the constant stuff. Here's an experiment that could be tried: run hello.e not by the usual 'rune' (which ends up invoking a rather elaborate E program which does special things for 'top-level' programs), but by a Java stub which does nothing but create a vat, then parse and evaluate the code. -- Kevin Reid <http://switchb.org/kpreid/>