To: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Speed tuning programs Date: Fri, 12 Aug 1994 19:11:39 +0100 From: Olly Betts Hi, I've written a program which does reduction of cave survey data, which works much like a compiler to give you some idea. I've ported it to DJGPP, which is great as it means it can use all the memory in the machine and VM too. Much praise to DJ and co. for all the work put in. I'd like to be able to supply people with just one version, with a separate Borland C compiled version available if they have a 286 or below, so I did some timings, summarised below: Compiler Time (secs) BCC 3.1, no opt 5.60 BCC 3.1, -Os size 5.49 BCC 3.1, -Ot time 5.44 DJGPP 1.11m5 -O2 6.87 DJGPP 1.12 -O2 6.43 BCC was set to produce 8086 code (the default) and I didn't turn on or off any other options in any of the cases. The BCC no opt may have been a slightly older version of the program and a bit faster than the others. The machine is a 486DX2, 66MHz, and I repeated each run until the time was repeated three times, to allow for the HDD card caching stuff. The tests were done in a full screen DOS box in Windows. The machine has 32Mb of RAM, so no swapping (hopefully). Unfortunately, I don't have a larger input data set handy, but the timings on this one are fairly constant on repeat runs. I read a message on this list suggesting that DJGPP is a bit weak if you're doing lots of I/O stuff, due to real/protected mode switching or something. The program does read and write in a fair amount of data, so this may have a bearing. What I'd like are any tips or suggestions for tweaking the performance of the DJGPP code to make it closer to the BCC code. Either compiler options or coding suggestions. As things stand, I'm currently supplying both executables and suggesting folk use the DJGPP one if they need more memory. Cheers, Olly