Re: Faster way of making long string?
- From: erewhon@xxxxxxxxxx (J French)
- Date: Mon, 25 Apr 2005 07:43:21 +0000 (UTC)
On Sun, 24 Apr 2005 19:51:01 +0200, Ekkehard Domning <edo@xxxxxxxx>
wrote:
>Hello
>
>J French wrote:
>> This is just delegating the inefficiency to TStringList
>as You see, Ian made a test and shows that the stringlist method is running at
>double speed as his approach. I would define "inefficiency" a bit different.
Check Chris Willig's example
- and that could be made faster by aggressive increasing of the buffer
size (eg: Len := Len * 2 )
>At the end of the discussion comes the question about the code. Should the
>code be "fast" or "maintainable".
It should be both
- but even more important, it should not be obscure
- creating a TStringList when you want one long string is 'indirect'
>Since we have very fast computers, and a lot
>of ram, I like it to have maintainable code, where ever it is possible.
Agreed
>If You compare the solution with a the stringlist and the solution chris
>suggest, I would choose, nearly in all cases, the stringlist alternative. It
>might be neccessary optimize on speed if zillions of string must be added, but
>until now I allways worke with stringlist.
This is not meant to be personal, but I have noticed that a lot of
Delphi coders are not really that familiar with working with Strings.
- because they are really a fairly recent addition to the language
Where you would use a TStringList I would probably use a dynamic array
or just one long string.
Obviously, I have a large library of string manipulation routines that
started life well before Delphi - in DOS BASIC and ASM
.
- Follow-Ups:
- Re: Faster way of making long string?
- From: Ekkehard Domning
- Re: Faster way of making long string?
- References:
- Faster way of making long string?
- From: Ian Hinson
- Re: Faster way of making long string?
- From: Ekkehard Domning
- Re: Faster way of making long string?
- From: J French
- Re: Faster way of making long string?
- From: Ekkehard Domning
- Faster way of making long string?
- Prev by Date: Re: Faster way of making long string?
- Next by Date: Re: Inactive shutdown service
- Previous by thread: Re: Faster way of making long string?
- Next by thread: Re: Faster way of making long string?
- Index(es):
Relevant Pages
|