Originally posted by: glugglug
Originally posted by: Descartes
For the record, making claims on performance (or lack thereof) are unfounded unless proper documentation can back it up. "sick joke" doesn't exactly quantify anything.
I'll venture that 90% of VB applications employ COM components written in C++, so the overhead is in COM, not the language itself.
OK, I'll back it up.....
Calling a C++ COM function that does nothing but return the system uptime in seconds as a double from a separate C++ application takes 1.99 microseconds per call on a 2GHz Pentium 4.
From "native" compiled VB this
same COM method call takes 60 microseconds. The slowness isn't just COM overhead because C++ managed to deal with the extra overhead on the
same COM function in just over 3% the amount of time.
Interestingly enough, VB is less efficient with COM than it is with normal method calls, but still nowhere near the speed it should be on those normal calls. Calling the function in the above example as a normal DLL method instead of through COM takes a little over 1 microsecond in C++, but 7 microseconds from VB, so the ratio of VB time to C time becomes 7 to 1 for normal Win32 DLLs vs. 30 to 1 for COM methods (assuming 0 time for the method call itself). I guess its possible (hell probably, I've got the overhead of a call to kernel32 within the COM method) that the ratio is worse than 7 to 1 for normal DLLs as well, just that the code WITHIN the call being executed is taking most of the 1 microsec from C++.