 |

01-17-2003, 12:26 PM
|
|
|
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.
|
|

01-17-2003, 01:16 PM
|
 |
Keeper of foo
Retired Moderator * Guru *
|
|
Join Date: Nov 2001
Location: Graceland
Posts: 15,612
|
|
|
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
|

01-17-2003, 05:48 PM
|
 |
Jedi Coder
* Expert *
|
|
Join Date: Aug 2002
Location: Abingdon, MD
Posts: 3,438
|
|
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. 
|
|

01-23-2003, 03:26 AM
|
|
|
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.
|
|

02-02-2003, 01:59 PM
|
|
|
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).
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|