Path: utzoo!mnetor!uunet!husc6!panda!teddy!jpn From: jpn@teddy.UUCP (John P. Nelson) Newsgroups: comp.sys.ibm.pc Subject: Turbo C vs. Microsoft Message-ID: <4516@teddy.UUCP> Date: 12 Dec 87 22:14:43 GMT Reply-To: jpn@teddy.UUCP (John P. Nelson) Organization: GenRad, Inc., Concord, Mass. Lines: 83 I just recently aquired Microsoft C 5.0, and I decided that it would be interesting to pit both Quick C and MSC 5.0 against Turbo C with a few benchmark programs. I think that the net might be interested in the results. I don't claim that I did a COMPREHENSIVE comparison, but I did get a couple of interesting data points. I've got results from three programs: #1: sieve.c, as distributed with MSC. #2: dhrystone 1.1. #3: MicroEmacs 3.9e. #1 and #2 were compiled with the small model on all compilers, and #3 was compiled large model. I've got several comments that don't really fit into the table, also (see below): TCC: turbo C QCL: quick C CL: microsoft C 5.0 +---------+----------+---------+---------+------+------+------+---------------+ |Source | Compiler | Special | Compile | Run | .OBJ | .EXE | Special | |Program | | Flags | Time | Time | Size | SIZE | | +=============================================================================+ | | | | | | | | Before Exepack| | | TCC | | 16 | 26 | 8646 | 5791 | 13714 | | +----------+---------+---------+------+------+------+---------------+ | sieve.c | QCL | | 24 | 31 | 900 | 7221 | 15423 | | +----------+---------+---------+------+------+------+---------------+ | | CL | -Ox | 30 | 21 | 474 | 7189 | 15391 | +=============================================================================+ | | | | | | | | Dhrystones | | | TCC | | 17 | 55 | 2302 | 9044 | 909 | | +----------+---------+---------+------+------+------+---------------+ | dry.c | QCL | | 27 | 60 | 3634 |10683 | 833 | | +----------+---------+---------+------+------+------+---------------+ | | CL | | 50 | 48 | 2577 |10331 | 1014 | | +----------+---------+---------+------+------+------+---------------+ | | CL | -Ox | 50 | 39 | 2413 |10171 | 1282 | +=============================================================================+ | | | | | | | | .OBJ |LIBRARY| | | TCC | -ml -O | 9:04 | ** | ** | 94250| 65247 | 7857 | | Micro +----------+---------+---------+------+------+------+---------------+ | Emacs | QCL | -AL | 12:45 | ** | ** |136145| 94349 | 9569 | | 3.9e +----------+---------+---------+------+------+------+---------------+ | | CL | -AL -Os | 26:16 | ** | ** |113287| 72791 | 9569 | +=============================================================================+ Special Entries: 1. For sieve.c, all three compilers benefitted from EXEPACK, because of a large initialized (to zero) array. 2. For dry.c the # of drystones reported by the program. More is better. See the notes on hardware configuration. 3. For MicroEmacs, I did not list the execution time nor .OBJ size. What I DID list was the component of the text size contributed by the combined .OBJs, and the component contributed by the large model library. I also compiled using the "optimize for size" option, since I was hoping to shrink the program enough to make it fit into the Compact model. No such luck. Turbo C showed well. It generated the most compact code for all benchmarks. Both the library and the .OBJ code size beat both Quick C and MS C. Also, Turbo C beat quick C in compile time, execution time, and executable size. Quick C showed badly. It was inferior to the other compilers in nearly all respects (it is faster than QC, but that's about it). Microsoft C did about as I expected. It's still a slow mother of a compiler, but it generates fast code. One thing that surprised me was that it generated BIGGER code than Turbo C, even if it was faster. I also tried Microsoft C with the -Ox option on MicroEmacs, but that made even larger code. I don't really like the integrated environments, my main concern is compile speed and program performance. I also did not compile for debug under any compiler: this is the main benefit of QCC over Turbo. No doubt this would have increased the compile time. Note: You are almost GUARANTEED not to get the same results I did (timewise, anyway), because I have a weird configuration. I have a XT clone with an 80286 accelerator card, and a Megabyte of disk cache (EMS). I made sure the disk cache was flushed before each run to make sure that this did not effect the results (Turbo C ran even FASTER when I didn't do this).