Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sample.eng.ohio-state.edu!purdue!ccncsu!lamar!mglacy From: mglacy@lamar.ColoState.EDU Newsgroups: comp.lang.pascal Subject: Sorting with 80x87 Message-ID: <14826@ccncsu.ColoState.EDU> Date: 10 May 91 13:17:19 GMT Sender: news@ccncsu.ColoState.EDU Lines: 31 Sender: Reply-To: mglacy@lamar.ColoState.EDU () Followup-To: Distribution: Organization: Colorado State University, Fort Collins, CO 80523 Keywords: Sorting, 80287, 80387 I revised a program to take advantage of my 80287 co-processor. The program generates some 10,000 values of a random variable, then sorts them and outputs a frequency distribution for the variable. I find that, in the {$N+} mode, the program is only marginally faster in overall exec. time. Everything except the sort seems to run MUCH faster, but the sort is now a real dog. Sorting in {N+} mode is so slow that it negates the time saved elsewhere in the program. I'm using a plain-vanilla Quick Sort, which in the {$N-} state sorted the array[1..10000] of real in a couple of seconds; when I changed to the {$N+} state (and changed all the reals to extended), the sort portion of the program was MUCH slower. I'm using TP4.0, but writing essentially standard Pascal code. 1. Why is the sort so slow? I wouldn't think that sorting extended values, even though they are 10 bytes long (vs. 6 bytes for ordinary software reals), would make so much difference. 2. Can anyone think of a way to get around this slowdown? Thanks, Mike Lacy