-
Website
http://www.monien.net/blog -
Original page
http://www.monien.net/blog/index.php/2008/10/delphi-2009-tstringbuilder/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
RobertWachtel
1 comment · 1 points
-
djuro
1 comment · 1 points
-
iheinacher
1 comment · 1 points
-
cornerskir
1 comment · 1 points
-
CRM455
1 comment · 1 points
-
-
Popular Threads
Another example; TStringBuilder.Replace is about 3 times faster than StringReplace.
TStringBuilder is implemented around a dynamic array, meaning that it's performance is going to be in the same ballpark as Strings, as the VCL internals for growth and data copy are the same. Differences are going to come from the overhead of the respective function calls.
Incidentally this means String will win (all the time) against TStringBuilder whenever you concat more than one string at once (s:=s+s1+s2+...), because the RTL has a function for that (which will realloc only once), whereas TStringBuilder doesn't.