I couldnt find an answer to my question on the forums so I thought I would investigate myself.

In VB6 you always called a function and passed it the variables you want to work with.

e.g Split( MyString, ",")

In .Net you can now do this instead

MyString.Split(","c)

which passes your arguments straight to the instance class.
Now I guess this was faster then the VB6 way and wanted to know by how much. I was amazed at the difference.

For all you programmers who have just converted your apps from VB6 to .Net, this can make a massive difference to speed.
Change your Lefts, Rights, Splits, Instr, InstrRev etc to use the class directly.
Also replace any string concats with the StringBuilder class which is also amazingly quick. I have shaved seconds off compression functions with it. (70 meg in less then 1 second!)

My current project is building a server application, so has to be at top speed all the time, so any other tips would be gratefull !!


----------------

If you want to see for yourself, run the code below, but bring up your dissasembly window (Ctrl+Alt+D) and see how many calls each function makes. The first function is about 30, the second goes on for hundereds.

VB Code:
  1. Dim strMessageString As String = "ABCD,EFGHIJ,KLMNOPQ,RSTUVW,XYZ"
  2.         Dim strString() As String
  3.  
  4.  
  5.         strString = strMessageString.Split(","c)
  6.  
  7.         strString = Split(strMessageString, ",")