On Fri, Oct 25, 2002 at 09:15:07PM +1000, Rhys Weatherley wrote:
> A "trick" that I've found very useful in the past is to design
> the bytecode format so that it can be mmap'ed into a block of
> memory, and then executed almost immediately with the minimum
> number of fixups.  Rather than copying the instructions, you
> execute them directly out of the mmap'ed region.

[snip advantages of a read only mmap over other options]

> Just an idea.  Apologies if I'm rehashing something that has
> already been discussed previously and discarded.

IIRC speed is parrot's number 2 priority (after correctness), so anything
that makes parrot faster is good. I remember that a while back Dan was
suggesting some change or addition to the bytecode format that would have
meant that the file could not have been mapped read only. Two people (I was
one) commented that this was a bad thing, because being able to mmap read
only was very useful, for the reasons you describe.

I wasn't aware that the bytecode format had changed sufficiently to
preclude mapping the whole file in read only (even if the current reader
doesn't do this), but I admit that I've not been following changes closely.

Nicholas Clark
-- 
Brainfuck better than perl?     http://www.perl.org/advocacy/spoofathon/

Reply via email to