Go Back  Xtreme Visual Basic Talk > General Discussion > Tech Discussions > Visual Basic versus Visual C performance


Reply
 
Thread Tools Display Modes
  #1  
Old 01-17-2003, 12:26 PM
emoreira
Guest
 
Posts: n/a
Default Visual Basic versus Visual C performance


Hi people :

A question that many of us make to ourselves. I´ve not received a convinced answer.

I´ve heard already thousand times that programs writen in C run "better" and "faster" than programs written in Basic. The same for Visual C against Visual Basic.
Even Visual C has better press than Visual Basic, I mean, a commercial software written in C seems to be "stronger" than a commercial program written in Visual Basic.
I understand that programs can be well written or not so well, no matter which language is used, but I´m talking of well written programs, in both languages.

But, what is the truth behind all this.
Suppose a program that works in a network.
The program will use the winsock that comes with Windows, no matter if the program was written in Visual C, Visual Basic or whatever language the programer is using.
Let´s supposed that that asumption is true, that means that the Visual Basic program does things in a slower way than the one in Visual C, so, the Visual Basic compiler is charging our code with processor instructions to do nothing.

I´m not a Visual C programer. I think that I write optimized code in Visual Basic.

I will appreciate comments.
Reply With Quote
  #2  
Old 01-17-2003, 01:16 PM
reboot's Avatar
reboot reboot is offline
Keeper of foo

Retired Moderator
* Guru *
 
Join Date: Nov 2001
Location: Graceland
Posts: 15,612
Default

Winsock in c will be no faster than Winsock in VB. Depending on what you're doing, c programs will typically run faster than the same VB program. That VB program, however, will typically take 1/10 the time to develop. The software developer needs to learn what kinds of things will run faster with which language (graphics will almost always be faster in c, for example, database access will be about the same for either) and then wisely choose the appropriate language to use for the situation. There is no such thing as "this is the best language for all situations" anymore than there is "this is the best OS for all situations".
__________________
~ Quod non mortiferum, fortiorem me facit ~

Avatar by lebb
Reply With Quote
  #3  
Old 01-17-2003, 05:48 PM
Machaira's Avatar
Machaira Machaira is offline
Jedi Coder

* Expert *
 
Join Date: Aug 2002
Location: Abingdon, MD
Posts: 3,438
Default

It also depends on the person coding the apps. A crappy C/C++ programmer can produce an app that is many times slower than a VB app by a good programmer. Reboot's correct. Some languages, however, are better suited for some things - You're not going to produce a Doom III clone in VB.
Reply With Quote
  #4  
Old 01-23-2003, 03:26 AM
cppandasm
Guest
 
Posts: n/a
Default vb v c

really depends how much "joining-the-dots" v "writing-the-dots" coding. What I mean is, if the majority of your coding is using library functions, there'll be little difference (assuming both languages compile and produce similar minimal call overheads), if you are having to do anything "algorithmic" yourself, then c will execute quicker (assuming you can actually code decently in it). c is very compact syntax wise too in this respect, something i find frustrating about vb. you have a lot more compiler optimization ability in visual c++ IDE than in vb, and if portability issues aren't important, you can always inline assembly (you can easily make things slower doing this, of course). vb, of course, compiles nowadays, but beware, both vc++ and vb can produce some rotten slow binary and i'm not just talking debug builds. anyway for winsock, your code is as fast as the slowest link, and I'll hazard a guess that's your network interface card.
Reply With Quote
  #5  
Old 02-02-2003, 01:59 PM
emoreira
Guest
 
Posts: n/a
Default vc++ versus bv

Thanks people for your comments.
The application I did in vb does, basically, wait.
It waits inputs from the ethernet card from the source IP address, processes the incomming message and sends the result to the ethernet card to the destination IP address.
The process it does with the incoming data is very simple and insumes almost no time.
OS is W2K, running in a PIII - 750 with 128 Mbytes RAM.
No other thing runs in that PC. CPU averages 1 to 2 % at full load.
The data stream is a 64 kbps serial link inserted in an ethernet LAN.
Application runs priorized as high (not real time).
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->