From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CEB34-00088S-Rm for qemu-devel@nongnu.org; Sun, 03 Oct 2004 14:25:30 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CEB34-00088G-E5 for qemu-devel@nongnu.org; Sun, 03 Oct 2004 14:25:30 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CEB34-00088D-Bx for qemu-devel@nongnu.org; Sun, 03 Oct 2004 14:25:30 -0400 Received: from [64.233.170.205] (helo=mproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CEAvO-00028y-VB for qemu-devel@nongnu.org; Sun, 03 Oct 2004 14:17:35 -0400 Received: by mproxy.gmail.com with SMTP id 73so314966rnl for ; Sun, 03 Oct 2004 11:17:33 -0700 (PDT) Message-ID: Date: Sun, 3 Oct 2004 14:17:33 -0400 From: Karl Magdsick Subject: Re: [Qemu-devel] [Patch] Clear memory using memset instead of handcoded loop In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: Reply-To: Karl Magdsick , 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 Cc: Daniel Egger Daniel, Good catch! Is the section still a hot spot in your tests? Maybe a macro or inline function would be more appropriate. The macro/inline function could be defined to use memset for now, and later changed to use optimized inline assembly language on architectures that don't inline memset. It is also likely possible to write a slightly faster inline assembly routine since we know that we want to always set the memory to zero, while memset has to allow for an arbitrary fill value. -Karl On Sun, 3 Oct 2004 13:45:51 +0200, Daniel Egger wrote: > Hija, > > while profiling the lastest qemu snapshot on OS X I discovered > that one of the tb_hash clearing routines turnes up to be a > "hotspot" during my typical test procedure which includes > booting an installed Debian Sarge RC. > > Attached patch turnes three handcoded memory clearing routines > into a call to memset which will be optimized by every serious > compiler into either a very optimized inline sequence for the > CPU or at least into a call of an optimized memory clearing > function (bzero on Darwin 7.5 with gcc 3.3). > > Please CC me on replies. > > > > > Servus, > Daniel > > > _______________________________________________ > Qemu-devel mailing list > Qemu-devel@nongnu.org > http://lists.nongnu.org/mailman/listinfo/qemu-devel > > > > >