Solved

Visual Basic reference

Posted on 2004-10-13
3
410 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Complex SQL statement in VB.NET 7 40
vb.net sendkey 4 19
VB.net Excel VSTO Add-in version compatability 2 18
Web page design problem 3 19
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

730 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