My team codes our GIS applications primarily in VB, with one developer that can drop into C++ for the intense math portions. We also use XML extensively as our data transport mechanism between the GUI components and the database components. We use the DOM for parsing XML, but tend to build the XML by using conventional string manipulation.
This ASP white paper makes it look like there is a difference, but I'm not sure how reliable it is...
If all you care about is concatenation speed, then just make a new string type that is implemented as a linked list of fragments... Then concatenation is just setting a pointer. (each fragment may need a reference count for memory management; and if you want to do anything else with these strings you'll have to convert them back to regular strings - though it's only a single O(n) operation)
Do some easy tests and you find all sorts of interesting things.
"Also, r = a & (b & c) is MUCH faster than r = a & b & c when a is a large string. "
If you are going to do string concatenation in any volume, I reccomend you write a DLL or OCX to handle it for you. I made a class with a single function, taking variant containing an array of b-strings and returning a single bstring. The performance win comes from precalculating the length needed for the output string, and allocating that ONCE, thus:
You can do it in VB by Preallocating the string and using Mid to place your concatenated text.
Optimising string concatenation in VB is a well worn issue that has been covered to death in many forums ( including http://peach.ease.lsoft.com/scripts/wa.exe?A0=visbas-l ). No need to discuss it here. ;-)
You do the math in C(++) and the string concat's in VB. But did You know that VB(6?) is relatively good and efficient in Math (only 10-15% slower that VC), and VERY BAD in string concats! What VB does is copy the original strings to a new string with EVERY concat You do! This is a very slow and in-efficient proces. Of course this could be many times faster by simple reconnection of string pointers. For this reason the environment I normally work in has a dedicated COM (and proprietary) string concat module wich is written in C and wich performs string concat up to 1000 times faster than VB!
Fog Creek Home