Path: csiph.com!1.us.feeder.erje.net!feeder.erje.net!1.eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!border1.nntp.ams1.giganews.com!nntp.giganews.com!buffer1.nntp.ams1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail NNTP-Posting-Date: Sun, 05 Feb 2017 07:03:51 -0600 From: Gareth Owen Newsgroups: comp.lang.c Subject: Re: language changes to optimize for speed in qsort? References: Date: Sun, 05 Feb 2017 13:03:51 +0000 Message-ID: <87a8a0n614.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:uiEvLEmnIpJq7nD24MxbXnDiVvk= MIME-Version: 1.0 Content-Type: text/plain Lines: 17 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-kVmH/myAkXXNj0Sn/nW0R5Ew0/1TmCE+kmEyLgBLW9zwjLJNmy7hC1z+A6ESed5vNdbveyubYfaJPmB!Y02Z2UYxc3k+a/VbYkEHRjMEh54u4FY88OcApUHoO67gqnOmV1Mvr8IKlN6WJJTbu/s1mMA= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2049 Xref: csiph.com comp.lang.c:103196 Malcolm McLean writes: > However once league-type data is established, often it is impossible > or almost impossible for anything to move more than one or two places > on each pass. Sorting a football league will be done in microseconds > even with an N**2 sort of course Sorting a football league will take microseconds, because football leagues tend to have 20-30 teams in them. So, as long as you avoid bogosort(), it almost certainly doesn't matter. On those occasions when it does matter (e.g. your league secretary insists on processing match results using an 16-bit micro running at 1Mhz), the only way to choose the best algorithm is by measurement on typical data. If you're using asymptotic analysis to determine how to sort thirty items, then you do not understand the puropose or limitations of asymptotic analysis.