Re: TeamB, Borland, admit obvious
From: Barry Kelly (barry_j_kelly_at_hotmail.com)
Date: 03/09/04
- Next message: Anders Ohlsson (Borland): "Re: StarBucks web service"
- Previous message: eshipman: "Re: StarBucks web service"
- In reply to: Hrvoje Brozovic: "TeamB, Borland, admit obvious"
- Next in thread: Rudy Velthuis (TeamB): "Re: TeamB, Borland, admit obvious"
- Reply: Rudy Velthuis (TeamB): "Re: TeamB, Borland, admit obvious"
- Reply: Hrvoje Brozovic: "Re: TeamB, Borland, admit obvious"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 09 Mar 2004 20:55:58 +0000
On Fri, 5 Mar 2004 13:10:56 +0100, "Hrvoje Brozovic" <a.b@c.de> wrote:
> Using the plus (+) operator has the same effect on two
> strings as using the Concat function:
> S := 'ABC' + 'DEF';
>
> Tip: The plus operator is faster than Concat.
>
> MY NOTE: Borland encourages developers to use it.
> s1 := s2 + s3 calls LStrCat3
> s1 := s1 + s2 calls LStrCat
>
> MY NOTE: Obviously s1 += s2 is treated as special case by Borland.
However, LStrCat cannot know how long the final string is going to be.
> MY NOTE: Borland always tries to resize in place,
Again, this *might* work *once*.
> When performing repeated concatenations of the type:
> For I = 1 To N
> Dest = Dest & Source
> Next N
>
> the length of time increases proportionally to N-squared.
This is true in Delphi and VB and in any other language compiler which
cannot fortell the future. I recommend using a TStringList or
something similar to build very long chains of concatenations.
> Steps 2 and 6 are very expensive and basically ...
A constant time increase, irrelevant as it will be dominated by the
n^2 function observed earlier.
> MY NOTE: to achieve performance in the same order of magnitude (but still
> much slower) as Delphi,
> Microsoft has nothing to offer Visual Basic developers other than hack.
This is incorrect. The Delphi native code is only slightly better than
VB, and only by a constant factor.
> If you going to use StringBuilder, it cant pass as
> minor change in anybody's book.
I already used TStringList as a StringBuilder, so I personally don't
see the problem.
-- Barry Kelly If you think the problem is bad now, just wait until we've solved it. -- Arthur Kasspe
- Next message: Anders Ohlsson (Borland): "Re: StarBucks web service"
- Previous message: eshipman: "Re: StarBucks web service"
- In reply to: Hrvoje Brozovic: "TeamB, Borland, admit obvious"
- Next in thread: Rudy Velthuis (TeamB): "Re: TeamB, Borland, admit obvious"
- Reply: Rudy Velthuis (TeamB): "Re: TeamB, Borland, admit obvious"
- Reply: Hrvoje Brozovic: "Re: TeamB, Borland, admit obvious"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|