From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BV7Qe-00082Z-3I for qemu-devel@nongnu.org; Tue, 01 Jun 2004 07:27:36 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BV7Qc-00081b-7V for qemu-devel@nongnu.org; Tue, 01 Jun 2004 07:27:35 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BV7Qc-00081Y-3o for qemu-devel@nongnu.org; Tue, 01 Jun 2004 07:27:34 -0400 Received: from [213.146.130.142] (helo=trantor.org.uk) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1BV7QG-0005n2-NK for qemu-devel@nongnu.org; Tue, 01 Jun 2004 07:27:13 -0400 Subject: Re: [Qemu-devel] [PATCH,RFC]: Generic memory callback regions From: Gianni Tedesco In-Reply-To: <1086088420.21275.6.camel@localhost> References: <1086058382.21903.53.camel@sherbert> <1086088420.21275.6.camel@localhost> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-UifXNNBAobNNY8zY6Rpa" Date: Tue, 01 Jun 2004 12:26:43 +0100 Message-Id: <1086089203.21922.70.camel@sherbert> Mime-Version: 1.0 Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --=-UifXNNBAobNNY8zY6Rpa Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue, 2004-06-01 at 06:13 -0500, Joe Batt wrote: > I haven't read your patch, but I recently wrote a SH2 emulator. We > found that a lot of time was spent finding the right callbacks, so for > the device memory, we used a sorted array. After each access, we > bubbled that memory region closed to the beginning of the array. This > turned out to be faster than the tree that we were using. The main > differences are we have 100+ regions and implemented it in Java. Good call. Move-to-front heuristic seems smart because I anticipate (and you found out for real) that memory accesses will have temporal locality. Moving to head is theoretically the same or a little better than 'bubbling up' actually, Knuth covers it in Vol 3 as i recall. Well, it becomes irrelevent for this case now, as I am implementing this privately in pciproxy.c, rather than publically in exec.c, and in my case the list is always 1 item long :) --=20 // Gianni Tedesco (gianni at scaramanga dot co dot uk) lynx --source www.scaramanga.co.uk/scaramanga.asc | gpg --import 8646BE7D: 6D9F 2287 870E A2C9 8F60 3A3C 91B5 7669 8646 BE7D --=-UifXNNBAobNNY8zY6Rpa Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBAvGfykbV2aYZGvn0RAo+xAJ9NtMZLS9n+/bg2YrWvUzDVNLktmwCfWoSq FobIaxVZkh43edx1F48X2S8= =oNm0 -----END PGP SIGNATURE----- --=-UifXNNBAobNNY8zY6Rpa--