Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mcvax!botter!ast From: ast@cs.vu.nl (Andy Tanenbaum) Newsgroups: comp.os.minix Subject: Re: minix C compiler performance Message-ID: <1192@botter.cs.vu.nl> Date: Sun, 31-May-87 15:25:43 EDT Article-I.D.: botter.1192 Posted: Sun May 31 15:25:43 1987 Date-Received: Tue, 2-Jun-87 02:15:34 EDT References: <1131@rocksvax.UUCP> Reply-To: ast@cs.vu.nl (Andy Tanenbaum) Organization: VU Informatica, Amsterdam Lines: 58 Marty Leisner recently posted a note saying the MINIX C compiler ran 20% the speed of an MS-DOS compiler. This figure disagrees with an earlier posting about dhrystones, and also disagrees with my comparisons with other compilers. The MINIX binaries were made with the PC-IX compiler, and these are typically about 15% smaller and faster than the MINIX ones. I think the dhrystone tests must use some feature that the MINIX compiler is poor at (like it doesn't use registers), but I can't imagine that you will get a factor of five difference across the board with real programs. It would be interesting to see measurements of real programs (e.g., commands/*.c) with MINIX and other compilers. The main problem with the C compiler is that it is completely table driven, and the code quality depends on how much work the table writer put into optimization etc. This particular table writer, who shall remain nameless here, did not especially like the 8088 architecture, and wanted to get the job done as fast as he could. As soon as the compiler worked correctly, and passed a large battery of compiler test programs that are part of ACK, he stopped work. The only way to improve it is for someone who has ACK to go back to his tables and optimize them. Our 68020 compiler, for example, which uses the same software but has a much better driving table, produces code that is better than Motorola's own compiler. The table improvement can't be done from the "source" you can get from UniPress/Transmediair, because it requires running the compiler-compiler system, and the C compiler "source" for MINIX is the compiler, not the compiler-compiler (which runs on VAXes and SUNs with 30 or 40 megabytes of free disk space, and definitely not on PCs). Since universities can get the complete ACK source for $995 from UniPress or Transmediair, perhaps some professor who is interested in compilers can get it and have a student work on improving the quality as a Master's thesis. Code optimization on the 8088 ought to provide plenty of food for thought for the student. It obviously can be done, but requires some thinking. Another thing that might be worthwhile would be for someone who knows the 8088 assembly language fairly well to just look at the assembly code of a few simple programs, and see if there are any obvious places where the compiler messes up, other than not using registers. If there are, there might be a possibility of making another optimizer that reads in the assembly code and outputs an optimized version of same. The current optimizer, /lib/opt, works on the intermediate code only, and does not include any 8088-specific optimizations. I am starting to think about the MINIX 1.2 distribution. It will probably mostly contain bugs fixes and some of the new programs that have been posted here. I will describe it at great length later, but if you have been collecting bug reports and have been waiting until you get 100 of them before posting, now might be a good time to post them anyway. Likewise, if you have any useful programs that you intended to post but haven't yet, now is a good time. To repeat, I will get back to this subject at length later, and will post all the differences between 1.2 and 1.1 for the benefit of people with 1.1. The Atari version, incidentally, is coming along, but is still not finished, and will not be in 1.2. Andy Tanenbaum (ast@cs.vu.nl)