c vs vb

jcd
10-04-2001, 07:12 AM
This is a cpu usage question:
Does C in general take up more CPU than the same program written in VB 6. If so why?

Mill
10-04-2001, 07:45 AM
I would guess it would be just the opposite, since C is a little closer to Assembly language.

"The LORD is my strength and my shield" - Psalms 28:7

jcd
10-04-2001, 07:46 AM
I always thought(was told) C would be faster for calculations??

Sortarius
10-04-2001, 07:54 AM
Everything that I have been taught was that C was faster than VB simply because of the way that it was made. Once you make the exe for a vb program, then it speeds up a lot, and takes less room (of course), but it is still micro-ly slower than C. Thats the reason why games/systems are made in C rather than vb.

If I am wrong though, I would like to know too. hehe

Sort

quos deus vult peredere prius dementat

Mill
10-04-2001, 07:55 AM
This is my understanding of things, but I may be a little (or a lot) off: A C compiler compiles the C code into a machine (or maybe Assembly) language executable. Prior to VB5, VB was always interpreted rather than compiled, meaning individual lines of code would have to be read individually. I think that VB is now compiled to p-code (or pseudo-code) which is mostly compiled but still slightly interpreted.

In any case, I'd almost guarantee that if someone who had both ran some sort of benchmark test, the C would be both faster and take up fewer resources.

Again, I've been wrong before, so you may want to wait to get more input from others or look around on the net.


"The LORD is my strength and my shield" - Psalms 28:7

jcd
10-04-2001, 08:13 AM
I know languages such as perl is interpreted and I believe your right that C is turned into Assembly Language and then turned into machine language(the joy of 1's and 0's) but if you are correct and VB is still interpreted somehow that would make sense that C/C++ would be faster because of that middle layer of interpretation. Thank you
Regards
jcd

Laurent
10-04-2001, 08:19 AM
i also heard like you folks that C is faster than VB, but slightly. at least that's what my teacher told me in college. but the more it goes and the less you'll see the difference since the computers today are so quick and full of ressource compared to a few years back.... i think that the main factor today is the programmer, is he freeing the memory? got a good algorithm?...

I'll be amongst the best any minute now !

Banjo
10-04-2001, 08:21 AM
And of course, with VB6 you can now compile to native code making it faster still. I still don't know how a native code VB program compares to a VC++ program though.

jcd
10-04-2001, 08:23 AM
It is even starting to become braun(cpu, memory) over brains in some cases...old school programmers(like my teacher) had to pay close attention to memory and the algorithim...now it seems some programs could care a less...hardware is cheap but those extra days of work to make it very efficent is expensive...this is becoming a post for another board...oops and I started it all, so it is my fault :(
regards
jcd

Laurent
10-04-2001, 08:25 AM
i'm realy not sure VB is interpreted, but i know HTML and JAVA are interpreted by the browser

I'll be amongst the best any minute now !

jcd
10-04-2001, 08:28 AM
I believe that prolog may be interpretted(I cant spell)...if someone knows different please inform me....
regards
jcd

orufet
10-04-2001, 08:37 AM
<blockquote><font size=1>In reply to:</font><hr>

Thats the reason why games/systems are made in C rather than vb.

<hr></blockquote>


Not quite....Operating Systems are not made in VB becuase VB is dependend on Windows. That would be one pretty crappy OS, don't ya think? To use an OS in VB, you'd have to go out and buy Windows first!

"I do not agree with a word you say, but I will defend to the death your right to say it" - Voltaire

Flyguy
10-04-2001, 08:48 AM
It's an option to compile to a real executable or to p-code.
Because VB has a lot of external dependecies you can't just distribute the compiled executable without a setup.

About speed, VB can be fast, though for number crunching C will be faster. I think a VB program occupies (generally) more memory than an equivalent program made in C (unless you use MFC images/icons/wink.gif ), because at least MSVBVM60.DLL (1356KB) has to be loaded into memory, even when your VB program has just one single statement.

basdewaard
10-05-2001, 03:03 AM
Check out this thread (http://www.visualbasicforum.com/bbs/showflat.php?Cat=&Board=RandomThoughts&Number=48255&page=&view=&sb=&o=&vc=1) for more on VB vs C++.

<font color=blue> :: grin-r :: </font color=blue>

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum