Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!rutgers!cmcl2!lanl!cochiti.lanl.gov!jlg From: jlg@cochiti.lanl.gov (Jim Giles) Newsgroups: comp.lang.c Subject: Re: low level optimization Message-ID: <21436@lanl.gov> Date: 15 Apr 91 22:26:51 GMT References: <1991Apr9.213601.12309@agate.berkeley.edu> <1991Apr11.150858.4242@odin.diku.dk> Sender: news@lanl.gov Organization: Los Alamos National Laboratory Lines: 24 >> array[index++] = something; >> [...] > > That's crazy. If you want efficiency in QSort you should use > pointer arithmetic like: > > *(pointer++) = something; If your compiler does something which makes the first slower than the second, it's time to get a new compiler. At some time in the code you had to do something like: pointer = &array[1]; or even pointer = array; The compiler should be able to perform the same operation outside any loops and achieve the same level of optimization. The user's code needn't contain such things. J. Giles