Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Jun 2000 08:47:42 +0900 (JST)
From:      "Daniel C. Sobral" <dcs@newsguy.com>
To:        hackers@freebsd.org
Subject:   Optimization
Message-ID:  <200006052347.IAA00583@daniel.sobral>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200006052347.IAA00583>