Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Which is faster - com or exe?

Status
Not open for further replies.

5ilver5aracen

Programmer
Oct 24, 2004
32
0
0
GB
Hi
I'm fairly new to assembly language programming on win32 and I'm using nasm to do some quick number crunching. Can anyone tell me which is faster out of a COM or EXE?
Many thanks in advance.
 
COM is an archaic executable format which only supports really small (<64K) 16-bit programs. In order to run such programs in win32, windows first has to start a VM to run the program.

EXE format files on the other hand will be native to the operating system, will benefit from being 32-bit in nature, not restricted in code size, nor to the 16-bit segmented architecture. You'll also be able to access the win32 API.


--
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
 
Two points:

(1) In the very old days, .com files were supposed to start up a little quicker than .exes, but as Salem points out, this hasn't been true now for many years; in any case, start-up speed should be quick enough to be irrelevant (any comments on .net, anyone). If start-up speed is genuinely causing you problems, you need to think about what's going on. For instance, it's not a good idea to call an exe 47 million times in a loop from another application.

(2) Running speed depends on your code. Don't expect massive speed-ups by moving to nasm. If there's an underlying problem with choice of algorithm, any amount of careful optimization in assembly won't make things much faster. It's incredibly easy to write assembler that runs within 5% of the speed of compiled code, and not at all difficult to write assembler that's somewhat slower than compiled code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top