At 06:36 PM 4/12/2001 -0400, Uri Guttman wrote:
> >>>>> "DS" == Dan Sugalski <[EMAIL PROTECTED]> writes:
>
>   DS> The only difference between the aligned and unaligned runs is the
>   DS> pointer to the aligned data is on an 8-byte boundary, and the
>   DS> unaligned data is the aligned pointer plus 1.
>
>i am assuming this is an alpha (which i got to know too intimately for 9
>months).

Yup. (I thought that was in the message somewhere, but maybe not)

Anyway, I snipped the most of the rest. There are a variety of reasons for 
things being slow, and they vary from architecture to architecture. The 
point was more that the hit is reasonably big even if you're only looking 
at the smallish hits.

Lots of folks are coming into the field with relatively little (or no) 
experience with computers at a low level, and a lot of the rest of us need 
the odd refresher. :)

>   DS> What does this mean for perl? Probably not a whole lot, since we
>   DS> deal mostly with 8-bit character data. It does illustrate that it
>   DS> really *is* worth keeping alignment issues in mind when designing
>   DS> data structures.  (While the compiler will, presumably, generate
>   DS> aligned structure members, that doesn't mean that dynamically
>   DS> generated arrays of them will be properly aligned...)
>
>what about all the UTF stuff? i think allocating string buffers on 64
>bit boundaries makes sense if you can stuff 16/32 bit char codes in
>them.

Unicode is definitely affected by this, but it's also affected by other 
things. (I still need to cobble together some code to check the difference 
in time between UTF-8, UTF-16, and UTF-32 strings)

>since we will be doing our own memory management we can control
>this as well. it definitely matters for structures but i think it will
>for dynamic data too.

It actually matters more for dynamic data structures, as compilers tend to 
queitly align things well for you. It's tough to get stack variables 
unaligned, but it's pretty easy to get dynamically allocated ones all messy.

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to