From owner-cvs-all Sun Dec 10 11:46:57 2000 From owner-cvs-all@FreeBSD.ORG Sun Dec 10 11:46:53 2000 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from netau1.alcanet.com.au (ntp.alcanet.com.au [203.62.196.27]) by hub.freebsd.org (Postfix) with ESMTP id 37F8A37B400; Sun, 10 Dec 2000 11:46:52 -0800 (PST) Received: from mfg1.cim.alcatel.com.au (mfg1.cim.alcatel.com.au [139.188.23.1]) by netau1.alcanet.com.au (8.9.3 (PHNE_18979)/8.9.3) with ESMTP id GAA11045; Mon, 11 Dec 2000 06:46:37 +1100 (EDT) Received: from pc0640.alcatel.com.au ([139.188.24.25]) by cim.alcatel.com.au (PMDF V5.2-32 #37640) with ESMTP id <01JXKHMA82A8906D64@cim.alcatel.com.au>; Mon, 11 Dec 2000 06:46:35 +1100 Received: (from jeremyp@localhost) by pc0640.alcatel.com.au (8.8.7/8.8.7) id GAA03200; Mon, 11 Dec 2000 06:46:30 +1100 (EST envelope-from jeremyp) Date: Mon, 11 Dec 2000 06:46:28 +1100 From: Peter Jeremy Subject: Re: cvs commit: src/usr.bin/tail forward.c read.c reverse.c tail In-reply-to: <200012072214.eB7MEhF13510@earth.backplane.com>; from dillon@earth.backplane.com on Thu, Dec 07, 2000 at 02:14:43PM -0800 To: Matt Dillon Cc: cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG Message-id: <20001211064628.A3197@pc0640.alcatel.com.au> MIME-version: 1.0 X-Mailer: Mutt 1.0i Content-type: text/plain; charset=us-ascii References: <3A2EEF7B.6F8F2BE@newsguy.com> <200012072214.eB7MEhF13510@earth.backplane.com> Sender: jeremyp@pc0640.alcatel.com.au Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, Dec 07, 2000 at 02:14:43PM -0800, Matt Dillon wrote: > I still remember all the 'register'ized hand-optimized C code and > embedded assembly in games and libraries specifically optimized for > VAXen. It's still very much in evidence... anyone remember all the > garbage that used to be in the 'compress' program to make it go fast > on a vax? I sure do! I suspect the effort was worthwhile. I know I've hacked compress on both Xenix-286 and M680[23]0 systems and achieved substantial speed-ups. In both the VAX and M68K cases, the speedup was achieved by replacing about 1/2 page of C with one (or a few) instructions in the inner loop - the register keywords were just needed to ensure that the relevant parameters were in the correct registers. The movement to RISC architectures has significantly reduced the scope for this sort of improvement. (The IA32 can be viewed as RISC-like here since many of its CISCier instructions tend to be slower than equivalent RISC-like sequences). And the issue of exploiting instructions that don't have simple C representations (like INSZV to continue the compress example) is going away as processor architectures are designed by examining instruction sequences generated by compilers (I believe this is the main reason that the Alpha doesn't have a rotate instruction). Increasing processor speed, compiler performance and portability requirements are reducing the incentive to hand-craft code to run faster on a specific implementation. I doubt I'd bother expending the effort to try and hand-optimise compress (or gzip) on a modern IA32 or Alpha. Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message