Ethereal-dev: Re: [Ethereal-dev] Re: question on TLV

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "Alok" <alokdube@xxxxxxxxxx>
Date: Tue, 13 Sep 2005 21:48:09 +0530
Please bear with me if i am a bit lost...

> In most cases I've seen, the "extra" bytes are usually the result of
> either a bug or a limited view of the world.  Let me explain a bit.
>
> When programming, extra bytes may be added to an in memory structure
> by the compiler to align members for better performance.  These extra
> bytes can be removed (to save memory) by packing the structure but at
> the cost of slower access.  (In many instances unaligned, 32 bit or
> 64 bit, memory references will be faster than byte aligned memory
> references.)
>
As long as the number of "fetches" from memory is the same, given that each
element is unique, how would it matter if I write them in 1 mem cycle or 2?
I still need to do:
mov <mem>,AX
mov <mem>,BX

do_something_different_with_AX_and_something_different_with_BX

so the mov <mem>,<reg> has to be done as many times right.. :-(

It might be for space, but I dont get the speed benefit........