Re: Password Generator
- From: erewhon@xxxxxxxxxx (J French)
- Date: Sat, 29 Oct 2005 12:24:15 +0000 (UTC)
On Sat, 29 Oct 2005 13:22:06 +0200, "Maarten Wiltink"
<maarten@xxxxxxxxxxxxxxxxxx> wrote:
>"Dr John Stockton" <jrs@xxxxxxxxxxxxxxxxxx> wrote in message
>news:equb2pIzkhYDFwme@xxxxxxxxxxxxxxxxxxxxx
>[...]
>> For some string types, length(s) is expensive, and should be done at
>> most once in the routine; at least in Pascal, it can be done at compile
>> time.
>Shortstring has the length as the byte at offset 0, ansistring as the
>dword at offset -4 or -8, I'm not sure which and it doesn't matter much.
>But in Delphi, Length() is not an expensive function unless you go out
>of your way to pass it a PChar.
AnsiString length is in the 4 bytes immediately preceeding the String
Data
The PChar stuff is not really that expensive unless the compiler
thinks that you are trying to mess around with a variable passed in as
a Const .. but I might have misunderstood there.
I must confess, I'm not that worried about the overhead of Length,
when one wants to optimize there are far more interesing and fecund
things to look at.
.
- References:
- Password Generator
- From: Ryan Styles
- Re: Password Generator
- From: Charles Appel
- Re: Password Generator
- From: Dr John Stockton
- Re: Password Generator
- From: Nicholas Sherlock
- Re: Password Generator
- From: Maarten Wiltink
- Re: Password Generator
- From: Dr John Stockton
- Re: Password Generator
- From: Maarten Wiltink
- Password Generator
- Prev by Date: Re: Password Generator
- Next by Date: Re: [Delphi 6] Introspection - iterate through all class members of a given type?
- Previous by thread: Re: Password Generator
- Next by thread: Delphi 7 v Delphi 2005
- Index(es):