Solved

Visual Basic reference

Posted on 2004-10-13
3
411 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
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…

688 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