Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 5th, 2003, 04:14 AM
Authorized User
Join Date: Sep 2003
Location: , , .
Posts: 25
Thanks: 0
Thanked 1 Time in 1 Post
Default Speed of VB for number-crunching


I am considering writing an ActiveX DLL with Visual Basic.

The DLL will perform about 5 million numeric calculations (mostly simple summations) using a small set of input data.

My question is - on a PC of about about 1 to 2 GHZ and (say) 256 MB of memory, roughly how long would 5 million computations take to complete in a VB DLL?

Is this a sensible course of action, or should I consider writing the DLL in another language (e.g. C) for significantly higher speed?

I am relatively new to VB and I have no "feel" for the speed of VB's processing.

Please give me a few pointers on this...

Many thanks.


Reply With Quote
  #2 (permalink)  
Old September 9th, 2003, 03:03 AM
Registered User
Join Date: Sep 2003
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

Take a look at this code which performs a total of 15 million simple calculations (and also 15 million simple if-then)

Private Sub Form_Load()
    Dim t As Long
    Dim a As Long
    Dim b As Long
    Dim c As Long

    a = 1
    b = 2
    c = 3

    For t = 1 To 5000000
        a = b + c
        b = a - b
        c = a + b
        If Abs(a) > 1000000 Then a = 1
        If Abs(b) > 1000000 Then b = 2
        If Abs(c) > 1000000 Then c = 3

    MsgBox "finished!"
End Sub

It takes about 2 seconds on my 866 MHz processor with 256 Mb RAM.
Reply With Quote
  #3 (permalink)  
Old January 27th, 2005, 10:48 AM
Registered User
Join Date: Jan 2005
Location: Mumbai, Maharastra, India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to shahood

I am programming with visual basic and my programme is to make the pdf file i am using acrobat object for all my purpose but one spot i am stuck is

How can i add stickynotes to my pdf file
How can i add highlighted rectangle in my pdf file
How can i add stamp in my pdf file
I have tried with the jso object i am able to add fields like button and text but
unable to add the above three

Reply With Quote
  #4 (permalink)  
Old January 27th, 2005, 12:59 PM
Friend of Wrox
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts


If you are using VB.NET, I have read that there is essentially no speed difference between VB.NET and C#.

If you need to interact with strings in your computations, that might really slow you down. Do you?
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Validation For Phone Number and Mobile Number dhruthi.ram99 Javascript How-To 12 October 30th, 2011 07:24 AM
speed umeshtheone VB Databases Basics 2 May 21st, 2007 04:12 PM
speed up macro Pindacko Excel VBA 1 April 27th, 2006 01:41 PM
Number Style from word in vb DorisTan VB How-To 0 November 4th, 2004 04:29 AM
Speed kilika SQL Server 2000 10 July 1st, 2003 06:27 PM

All times are GMT -4. The time now is 08:24 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.