Solved

Visual Basic reference

Posted on 2004-10-13
3
407 Views
Last Modified: 2010-04-24
I just found an interesting quote in a coding guidelines documents:

"Remove the Visual Basic reference from your project. Making use of the original Visual Basic functions has been proven to be up to 1000 times slower than the .NET counterparts; you have been warned."

Do you agree with this quote?

Do you have proof of that?
0
Comment
Question by:Éric Moreau
3 Comments
 
LVL 28

Accepted Solution

by:
iboutchkine earned 62 total points
ID: 12297471
I never noticed that and I find it very convenient to use VB functions sometimes. Maybe it is slower. It depends on what you are doing. Will it bother you if instead 0.00001 sec the process will finish in 0.01 sec?
0
 
LVL 25

Assisted Solution

by:RonaldBiemans
RonaldBiemans earned 63 total points
ID: 12297926
Well, I actually run a small test using the old mid function and the new substring method and there is indeed a difference.

But like Iboutchkine said it is pretty neclectable (when I run it 1,000,000 times the biggest difference is 30 milliseconds).

As you can see in the result below the .net way is always faster then the old method (although sometimes there equal in speed)

Dim s As String = "hallohallohallohallohallohallohallohallohallohallohallohallohallohallohallohallohallohallohallo"
        Dim ss As String
        Dim dd As Integer

        For i As Integer = 0 To 10
            Dim test As Integer = Environment.TickCount
            For x As Int32 = 0 To 1000000
                ss = s.Substring(1, 15)
            Next
            Console.WriteLine(Environment.TickCount - test)

            Dim test2 As Integer = Environment.TickCount
            For x As Int32 = 0 To 1000000
                ss = Mid(s, 1, 15)
            Next

            Console.WriteLine(Environment.TickCount - test2)
        Next

this was the result

125
141
125
125
109
141
109
125
125
125
110
125
109
141
109
125
110
140
110
125
109
125
0
 
LVL 70

Author Comment

by:Éric Moreau
ID: 12357218
It is not really convincing!!!
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

805 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question