Re: virtual machine efficiency

lars@bearnip.com (Lars Duening)
30 Dec 2004 01:06:13 -0500

          From comp.compilers

Related articles
virtual machine efficiency ed_davis2@yahoo.com (ed_davis2) (2004-12-29)
Re: virtual machine efficiency dido@imperium.ph (Rafael 'Dido' Sevilla) (2004-12-30)
Re: virtual machine efficiency anton@mips.complang.tuwien.ac.at (2004-12-30)
Re: virtual machine efficiency vbdis@aol.com (2004-12-30)
Re: virtual machine efficiency cr88192@hotmail.com (cr88192) (2004-12-30)
Re: virtual machine efficiency cfc@shell01.TheWorld.com (Chris F Clark) (2004-12-30)
Re: virtual machine efficiency lars@bearnip.com (2004-12-30)
Re: virtual machine efficiency calumg@no.onetel.spam.com (Calum Grant) (2004-12-30)
Re: virtual machine efficiency cr88192@hotmail.com (cr88192) (2004-12-31)
Re: virtual machine efficiency cr88192@hotmail.com (cr88192) (2004-12-31)
Re: virtual machine efficiency strohm@airmail.net (John R. Strohm) (2005-01-01)
Re: virtual machine efficiency kers@hpl.hp.com (Chris Dollin) (2005-01-12)
Re: virtual machine efficiency cr88192@hotmail.com (cr88192) (2005-01-14)
[2 later articles]
| List of all articles for this month |

From: lars@bearnip.com (Lars Duening)
Newsgroups: comp.compilers
Date: 30 Dec 2004 01:06:13 -0500
Organization: Compilers Central
References: 04-12-151
Keywords: VM, performance

ed_davis2 <ed_davis2@yahoo.com> wrote:


> [push address] takes one byte, and the address takes 4 bytes.
> If I pack the code into a byte array, this takes 5 bytes. However,
> now that means that address isn't on a word boundary. If I load
> 'address' using:
>
> unsigned char *code;
>
> operand = *(int *)code;
>
> I incur a speed hit on many processors, and it may even fail on
> others, since code probably isn't suitably aligned.


As a first step I would measure how much of a speed penalty you
actually incur by having to extract the adress data from out of the
bytecode (and yes, you will have to extract it for proper alignment).


Especially if your compiler recognizes memcpy() and compiles it into
optimized code, you might find that for example crossing the line
boundaries in your processor's L1 cache has greater impact than the
lack of alignment of single operands.


--
Lars Duening; lars@bearnip dot com



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.