From: Sean Middleditch Date: 2002-04-04T14:01:44+09:00 Subject: Re: About efficiency On Wed, 2002-04-03 at 23:48, Rik Hemsley wrote: > #if Sean Middleditch > > Well, that is a huge source of savings. I cut the run time of smaller > > scripts in half just with some compiler optimizations. Yes, the savings > > don't matter much for large applications, but a lot of people write > > smaller scripts. > > This advantage could be emulated using 'smart' block-allocation - but the > other two speedups sound nice, coupled with the option of adding a JIT > compiler. Ya, the other optimization that just hit me is the fact that there are less function calls in a byte-code situation. In a tree node, for each node you need to recursively call an evaluation function. With byte-code, you can have a single loop that pushes values onto a stack. While using a custom stack (a resizable array of values, basically) is slower than the C stack, the savings you make from the function call over-head is tremendous - plus, you won't ever run out of stack space, until you use up all of RAM and swap (which, while possible, isn't likely, especially if you cap the stack to, say, 10MB or something...) > > Rik >