From owner-freebsd-hackers Mon Jun 5 16:46:47 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from peach.ocn.ne.jp (peach.ocn.ne.jp [210.145.254.87]) by hub.freebsd.org (Postfix) with ESMTP id DBE2A37B84D for ; Mon, 5 Jun 2000 16:46:36 -0700 (PDT) (envelope-from dcs@newsguy.com) Received: from daniel.sobral (p06-dn01kiryunisiki.gunma.ocn.ne.jp [211.0.245.7]) by peach.ocn.ne.jp (8.9.1a/OCN/) with ESMTP id IAA10182 for ; Tue, 6 Jun 2000 08:46:34 +0900 (JST) Received: (from dcs@localhost) by daniel.sobral (8.9.3/8.9.3) id IAA00583 for hackers@freebsd.org; Tue, 6 Jun 2000 08:47:42 +0900 (JST) (envelope-from dcs) From: "Daniel C. Sobral" Message-Id: <200006052347.IAA00583@daniel.sobral> Subject: Optimization To: hackers@freebsd.org Date: Tue, 6 Jun 2000 08:47:42 +0900 (JST) Disclaimer: Klaatu Barada Nikto! X-Mailer: ELM [version 2.4ME+ PL68 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Can someone discuss the performance trade-offs of the following two alternative codes (and maybe suggest alternatives)? Problem: I need to retrieve two values from a table. Alternative A: x = table[i].x; y = table[i].y; Alternative B: d = table[i]; x = d & MASK; y = d >> SHIFT; -- Daniel C. Sobral (8-DCS) dcs@newsguy.com dcs@freebsd.org capo@there.is.no.bsdconspiracy.net To err is human -- to blame it on a computer is even more so. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message