Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lq35n-00030j-9f for qemu-devel@nongnu.org; Sat, 04 Apr 2009 06:27:15 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lq35i-0002wX-HW for qemu-devel@nongnu.org; Sat, 04 Apr 2009 06:27:14 -0400 Received: from [199.232.76.173] (port=44863 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lq35i-0002wU-BD for qemu-devel@nongnu.org; Sat, 04 Apr 2009 06:27:10 -0400 Received: from fmmailgate03.web.de ([217.72.192.234]:59052) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Lq35h-0007on-KX for qemu-devel@nongnu.org; Sat, 04 Apr 2009 06:27:10 -0400 Message-Id: <44CCDC38-8781-43F2-9C37-FC5A4EBF0787@web.de> From: =?ISO-8859-1?Q?Andreas_F=E4rber?= In-Reply-To: Content-Type: multipart/mixed; boundary=Apple-Mail-30-688083435 Mime-Version: 1.0 (Apple Message framework v930.3) Subject: Re: [Qemu-devel] [PATCH] Cocoa front-end performance improvement Date: Sat, 4 Apr 2009 12:26:44 +0200 References: <86E5ED63-AC0E-4D9A-A5C4-6FDAC8C56933@nokia.com> Sender: andreas.faerber@web.de 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 Cc: =?ISO-8859-1?Q?Juha_Riihim=E4ki?= --Apple-Mail-30-688083435 Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Am 28.03.2009 um 02:39 schrieb Alexander Graf: > > On 27.03.2009, at 19:47, Juha Riihim=E4ki wrote: > >> Any comments on this patch? I'm surprised that nobody else has =20 >> noticed how horribly slow the qemu monitor or any qemu console =20 >> window is when using Cocoa. And the reason is simple, current =20 >> implementation is forcing asynchronous updates to be done =20 >> synchronously. Fixing this also removes the slowness. > > Looks good to me and works on a quick test. > > Signed-off-by: Alexander Graf QEMU has always been horribly slow on OSX/ppc. Didn't measure the =20 exact performance improvements, but it doesn't seem to break anything. Acked-by: Andreas Faerber The patch appeared to be whitespace-damaged. Fixed version attached. --Apple-Mail-30-688083435 Content-Disposition: attachment; filename=cocoa-performance.diff Content-Type: application/octet-stream; x-unix-mode=0644; name="cocoa-performance.diff" Content-Transfer-Encoding: 7bit diff --git a/cocoa.m b/cocoa.m index 55ff2b4..f40067a 100644 --- a/cocoa.m +++ b/cocoa.m @@ -298,6 +298,11 @@ int cocoa_keycode_to_qemu(int keycode) [super dealloc]; } +- (BOOL) isOpaque +{ + return YES; +} + - (void) drawRect:(NSRect) rect { COCOA_DEBUG("QemuCocoaView: drawRect\n"); @@ -403,7 +408,7 @@ int cocoa_keycode_to_qemu(int keycode) } else { if (qemu_name) [normalWindow setTitle:[NSString stringWithFormat:@"QEMU %s", qemu_name]]; - [normalWindow setFrame:NSMakeRect([normalWindow frame].origin.x, [normalWindow frame].origin.y - h + screen.height, w, h + [normalWindow frame].size.height - screen.height) display:YES animate:YES]; + [normalWindow setFrame:NSMakeRect([normalWindow frame].origin.x, [normalWindow frame].origin.y - h + screen.height, w, h + [normalWindow frame].size.height - screen.height) display:YES animate:NO]; } screen.width = w; screen.height = h; @@ -922,7 +927,7 @@ static void cocoa_update(DisplayState *ds, int x, int y, int w, int h) w * [cocoaView cdx], h * [cocoaView cdy]); } - [cocoaView displayRect:rect]; + [cocoaView setNeedsDisplayInRect:rect]; } static void cocoa_resize(DisplayState *ds) --Apple-Mail-30-688083435 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit --Apple-Mail-30-688083435--