www.delorie.com/djgpp/v2faq/faq116.html | search |
You can tell how much your program switches to real mode by profiling your program. In the profile, look at the proportion of time your program spends in low-level library functions called
__dpmi_int
(which calls real-mode DOS/BIOS services) and __dj_movedata
(which moves data between the transfer buffer and your program). If this proportion is large, try
rewriting your program to minimize use of those functions which require a mode switch, even at a price of more computation (a mode switch usually eats up hundreds of CPU cycles).
__djgpp_exception_processor
is high on
the execution profile printed by Gprof. Due to the way FP emulation is implemented in DJGPP(Note: Without a real x87 FPU, an exception is generated by the CPU each time a
floating-point instruction is seen in the code. __djgpp_exception_processor
is called for each such exception and services it by calling the emulator, emu387.dxe, or
functions from the emulator library libemu.a (if the program was linked with -lemu), to emulate the instruction. Since exception processing incurs a lot of overhead, this
emulation is slow.), it might be significantly slower than the way real-mode DOS compilers handle it. The solution is either to rewrite your code so that it doesn't use floating-point code in
its inner loops, or buy an FPU.
webmaster donations bookstore | delorie software privacy |
Copyright ⌐ 1998 by Eli Zaretskii | Updated Sep 1998 |
You can help support this site by visiting the advertisers that sponsor it! (only once each, though)