Library tutorials & articles

Performance Issues

Introduction

After spending weeks or even months creating your application, the last thing you want to find is that it takes half an hour to load, and uses up more memory than even windows manages to consume! This tutorial will show you how to limit memory usage, decrease file size, increase application performance, and how to measure performance. I hope your applications benefit from it!

Comments

  1. 29 Sep 2005 at 20:20

    And once again a greate article by james!

  2. 21 Mar 2002 at 09:09

    This posting is specifically a response to James Cowleys suggestion that using ByVal is quicker than using ByRef.  This is only true when calling an out-of-process server (i.e. and ActiveX EXE).  VB is designed to pass all parameters ByRef, which means that everything is passed as a 32-bit pointer.  When passing ByVal VB copies the contents of the parameter into temporary space and then passes a 32-bit pointer to the temporary space.  This means that, counter-intuitively, it is slower passing a long ByVal than it is ByRef.  
    When calling an out-of-process server OLE must marshal a copy of your parameter into the address space of the routine you are calling and then, if it is ByRef, copy it back afterwards.  This is probably the only occasion that passing ByRef is slower.
    Generally ByVal should be reserved for occasions when the routine is going to change the contents of the variable and the calling routine will be affected by the change.  At the very least use ByRef for all strings and variants.

  3. 01 Jan 1999 at 00:00

    This thread is for discussions of Performance Issues.

Leave a comment

Sign in or Join us (it's free).

James Crowley James first started this website when learning Visual Basic back in 1999 whilst studying his GCSEs. The site grew steadily over the years while being run as a hobby - to a regular monthly audience ...
AddThis

Related discussion

Related podcasts

  • Christian Beauclair

    14 mai 2008 (�mission #0074) ::.Christian Beauclair: Stratégies de migration VB6 vers .NET Nous discutons avec Christian Beauclair des stratégies de migration VB6 vers .NET. Entre autres, nous discutons comment utiliser le "VB 6 Code Advisor" et le "Interop Forms Toolkit" pour ajouter la puiss...

We'd love to hear what you think! Submit ideas or give us feedback