From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.devel Subject: Re: macOS graphics performance Date: Mon, 28 Dec 2020 00:25:00 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17629"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs-Devel devel To: Daniel =?iso-8859-1?Q?Mart=EDn?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Dec 28 01:26:17 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ktgMa-0004Vc-VI for ged-emacs-devel@m.gmane-mx.org; Mon, 28 Dec 2020 01:26:16 +0100 Original-Received: from localhost ([::1]:38748 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ktgMZ-0000Ew-Vs for ged-emacs-devel@m.gmane-mx.org; Sun, 27 Dec 2020 19:26:16 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54674) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ktgLY-0007jO-AH for emacs-devel@gnu.org; Sun, 27 Dec 2020 19:25:12 -0500 Original-Received: from outbound.soverin.net ([116.202.65.218]:38519) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ktgLU-0006fu-NV for emacs-devel@gnu.org; Sun, 27 Dec 2020 19:25:11 -0500 Original-Received: from smtp.soverin.net (unknown [10.10.3.24]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by outbound.soverin.net (Postfix) with ESMTPS id 21E196008F; Mon, 28 Dec 2020 00:25:06 +0000 (UTC) Original-Received: from smtp.soverin.net (smtp.soverin.net [159.69.232.138]) by soverin.net DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin; t=1609115105; bh=5X8EVC/cjJBDvPaFz6efljdJLF6t341R+1EYRzyAc+s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HdYuvNd97bs6ic6UrVFUZbQfGQt1BTF0Dedl5/hd6c9kVoW2UcmvWXbrR3Ku/Qfqd hBu7eYSGAqL1hykZhpdolJBumNT5Tz4L+dOSmI1fzXQtodxRWuq4r2mq1DSpMX9epl J6wb/z9Dp/JN2852bsQZlDE9psEHMFyHrl5sQtFEiM/CD5pvnyYwDSqFkEh1ExdKP1 EI/b0QHnkr4Alu5EkrmTywUEo8upmt0rbLjHk6gVjp/sHmQxArEW/go8KJohAt3uMa X9rxucMF0SK1RLp6nSNWApH5JLn3NH8jbvICqoDlHElXHxP/LGY/zrAysjuvm7Favu xOKlpg+y/EQdw== Original-Received: by breton.holly.idiocy.org (Postfix, from userid 501) id 5568C202941802; Mon, 28 Dec 2020 00:25:00 +0000 (GMT) Mail-Followup-To: Alan Third , Daniel =?iso-8859-1?Q?Mart=EDn?= , Emacs-Devel devel Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=116.202.65.218; envelope-from=alan@idiocy.org; helo=outbound.soverin.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:261964 Archived-At: On Mon, Dec 28, 2020 at 01:05:02AM +0100, Daniel Martín wrote: > Alan Third writes: > > > I've pushed some work I've done on the NS port's graphics to > > scratch/ns/performance. I would appreciate it if people running > > various versions of macOS give it a go. It should only improve things > > for people running macOS 10.14 and above, but I'd still appreciate > > knowing whether it breaks anything on older macOS versions. > > > > Thanks! > > Thanks! It seems to work fine here (10.15.7), although I had to apply > your additional patch, as I experienced the same problem as Andrii. Ah, good to know, thanks! > Is there any thread with more context about the performance changes in > the scratch/ns/performance branch? What should I focus my testing on? I've not written anything about it specifically. It's a continuation of the work that was done in the master branch a long time ago to make it draw to an off-screen buffer. Basically, in the master branch, it draws to a buffer, and then that buffer is copied into an image and handed to the GUI toolkit for display. The copying is a requirement of the type of buffer I was using. This branch draws into a different type of buffer which doesn't require us to make another copy, then it's handed to the GUI toolkit for display. These buffers also have some advantage in that they're copied to the VRAM asynchronously, whereas the other ones aren't. Because of the asynchronous copying I've had to use more buffers (at least two), and so there is a copy added back in to make sure they're all kept up to date. But it's still noticeably faster when there are a lot of large updates, for example in scrolling. I think in situations where there are a lot of small independent updates, like moving the point extremely quickly, it may be slower. I also rewrote the scrolling code, as I realised I have full access to the pixels and can copy them around with memcpy and friends. I tried porting that to the master branch, but it didn't have as large an effect as I'd hoped. So, basically, anything that involves drawing to the screen should, hopefully, be faster. Probably the biggest difference will be for people with large frames on hi-res screens scrolling around large buffers. -- Alan Third