?
Solved

Visual Basic reference

Posted on 2004-10-13
3
Medium Priority
?
412 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 186 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 189 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

777 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