What speed increases can I expect from C++


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: What speed increases can I expect from C++

Hybrid View

  1. #1
    Neal Andrews Guest

    What speed increases can I expect from C++

    Hi Jonathan,

    I mainly develop custom drawn controls in VB and use the API rather than VB
    in most of the drawing routines and use pointers for sorting strings and
    objects for some extra speed. What are the main areas in C++ that are
    quicker than in VB as they both use the same compiler and why. Also is an
    API function in C++ likely any quicker than in VB. I could see strings being
    a bit faster if not explicitly converted from a BStr early on.

    TIA
    Neal




    Share on Google+

  2. #2
    Jonathan Morrison Guest

    Re: What speed increases can I expect from C++

    Neal,
    Good question. I wrote the Black-Belt column of the January 2001 issue of
    Visual Basic Programmers Journal to address this question directly. In it I
    do an encryption algorithm in both VB and C++. The algorithm basically takes
    a string and loops through performing an XOR on each character. The VB code
    makes repeated calls to Asc(Mid$()) combination. The results are shocking!
    C++ .70 seconds for 10000 loops. VB 47 seconds. String manipulation is much
    slower in VB. As far as API calls go, C++ will be slightly faster for calls
    that pass strings because VB converts all strings to ANSI before calling the
    API that they are passed to. Even using StrPtr, VarPtr, and ObjPtr, well it
    is a moot point since they are going away in the next release of VB.
    You will be most happy to find out that drawing is one area that C++ blows
    away any language as far as speed is concerned. Pixel manipulation in C++ is
    just about real-time!

    I hope this helps to answer your question. :-)

    Thanks,
    Jonathan

    "Neal Andrews" <neal@nandrews.freeserve.co.uk> wrote in message
    news:3a10fbd3@news.devx.com...
    > Hi Jonathan,
    >
    > I mainly develop custom drawn controls in VB and use the API rather than

    VB
    > in most of the drawing routines and use pointers for sorting strings and
    > objects for some extra speed. What are the main areas in C++ that are
    > quicker than in VB as they both use the same compiler and why. Also is an
    > API function in C++ likely any quicker than in VB. I could see strings

    being
    > a bit faster if not explicitly converted from a BStr early on.
    >
    > TIA
    > Neal
    >
    >
    >
    >



    Share on Google+

Similar Threads

  1. 2 Questions: license Installation and Speed
    By Aaron in forum Database
    Replies: 1
    Last Post: 02-25-2005, 07:16 PM
  2. ADO recordset retrieval speed
    By rkbnair in forum VB Classic
    Replies: 3
    Last Post: 08-09-2002, 06:31 PM
  3. WinSock OCX vs API - SPEED!?
    By rhwiebe in forum VB Classic
    Replies: 2
    Last Post: 05-30-2001, 02:54 AM
  4. WinSock OCX vs API - SPEED!?
    By rhwiebe in forum VB Classic
    Replies: 0
    Last Post: 05-29-2001, 07:41 PM
  5. Adding a record increases MEM Usage
    By Steve in forum VB Classic
    Replies: 0
    Last Post: 03-14-2000, 05:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center