|
-
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
-
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
>
>
>
>
Similar Threads
-
By Aaron in forum Database
Replies: 1
Last Post: 02-25-2005, 06:16 PM
-
By rkbnair in forum VB Classic
Replies: 3
Last Post: 08-09-2002, 05:31 PM
-
By rhwiebe in forum VB Classic
Replies: 2
Last Post: 05-30-2001, 01:54 AM
-
By rhwiebe in forum VB Classic
Replies: 0
Last Post: 05-29-2001, 06:41 PM
-
By Steve in forum VB Classic
Replies: 0
Last Post: 03-14-2000, 04: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
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks