Re: Where is stringbuilder?



On Thu, 19 Oct 2006 23:00:54 -0500, Rob Kennedy <me3@xxxxxxxxxxx>
wrote:

J French wrote:
Move would probably not be much faster, as although it moves 4 byte
chunks IIRC it assumes that the start position is on a 4 byte boundary

Also it uses : REP MOVSD
- which is a lot more elegant, but very slow

The Move procedure doesn't assume any alignment. At least, I can't find
any alignment requirements in the MOVSD documentation.

I explained myself incorrectly

When efficiently moving memory the trick is to 'top' and 'tail' with a
4 byte aligned 'move' of 4 bytes in between them.

Delphi 4 does the 'tail' bit, but if the start is not 4 byte aligned
it will be moving DWORDS that are crossing the 4 byte boundaries

Since this is pretty inefficient, I assume that the Delphi designers
'assumed' that mostly memory would be 4 byte aligned.

That or they never thought about it ....

I'm not really worried about micro-optimization, but for core library
routines that is one of the things we would watch out for.
.