From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Third Newsgroups: gmane.emacs.devel Subject: Re: redisplay and expose_frame Date: Sat, 4 Aug 2018 17:19:13 +0100 Message-ID: <20180804161913.GA74505@breton.holly.idiocy.org> References: <20180722124418.GA8674@breton.holly.idiocy.org> <20180724204220.GA9687@breton.holly.idiocy.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1533399481 541 195.159.176.226 (4 Aug 2018 16:18:01 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 4 Aug 2018 16:18:01 +0000 (UTC) User-Agent: Mutt/1.10.0 (2018-05-17) Cc: emacs-devel@gnu.org To: YAMAMOTO Mitsuharu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 04 18:17:56 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1flzFc-0008VW-Cu for ged-emacs-devel@m.gmane.org; Sat, 04 Aug 2018 18:17:56 +0200 Original-Received: from localhost ([::1]:55604 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1flzHj-0000CC-63 for ged-emacs-devel@m.gmane.org; Sat, 04 Aug 2018 12:20:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36679) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1flzGw-0000As-VW for emacs-devel@gnu.org; Sat, 04 Aug 2018 12:19:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1flzGw-0006fv-3K for emacs-devel@gnu.org; Sat, 04 Aug 2018 12:19:18 -0400 Original-Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:34371) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1flzGv-0006fB-SE for emacs-devel@gnu.org; Sat, 04 Aug 2018 12:19:18 -0400 Original-Received: by mail-wr1-x436.google.com with SMTP id c13-v6so8252475wrt.1 for ; Sat, 04 Aug 2018 09:19:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=yUyxAsG1M00q2Ha8L2NI31egDru+PBo4It65kBE5+Hs=; b=nX5aWjS/S34aDOcq/ZfEzFGjZF2qGYQORDkXVWEAR08K4EtAO1H3Htkz5ExxLYHY6f ENBTHzn3/mnzNp47pyRG3vvy6hBTP78iKHSvlYz1m0T86AvijIT9EIqOlXAu75jdvb1U xZgibfKWtLG/F8kjADvWKMHpUsfPrnsKEdn4s+2uqoeDstUsHvtbmMtZ0BJIIYFYrtHB WCcZ2k/uyiOS66bA1jw0o3gBUu3NEIYReI+Nr07fGQH8FkdObps143ZnHhbNkCks4hJt r8vKA4ZzJlFe/RznwbLd3EngIkBRdNOtbSAM/J0SxtJugT1HHe/JVd6F5VaJPyGhMIU1 9bjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=yUyxAsG1M00q2Ha8L2NI31egDru+PBo4It65kBE5+Hs=; b=tvnYYUWpu3/cnZG7NrqrlCFzb4WB7J16f+XBGBLW774tWFqIa21g+mWFTjfLOYBC/B 7QaQCheJfoJFyIMwjnN+ahiYi56yC8H/BZl8AwqCCv80t7Qgt4pcvUVRjE83JmrxzDL4 VFh6GYUTV9SOQ71ywe1yCj+5Jees8EepTOzNn1dTsrP8nW1fIngBxJjx2qnYtjml30cS ntQACgfZe71uLsC92CMGGqpTO3htc/wIr42VwICkRH8CU0Akbcb/GJ15qhhBE8ZkirP8 G+tEuqqz/P+WY/526SL1yZbrC05PVODlTcYd0uEr98VX1nmQlan7yD1QPGTg0awfeV6t 3L/Q== X-Gm-Message-State: AOUpUlFcuPN7q1ctaF0viKKtS4HGJb8Sj5lEacy7pphZy1CoasUiLCIR 1dbJrGu4+sg9WgGlGCLNRxY= X-Google-Smtp-Source: AAOMgpc+t7XnhI3rpDjKA2E0m2dkKa9kSCQgC6uokUwPN7nZ0d/H7a6VaZy+jl8tw+uFDcW4DHLuVA== X-Received: by 2002:adf:e0cc:: with SMTP id e12-v6mr5225512wri.199.1533399556545; Sat, 04 Aug 2018 09:19:16 -0700 (PDT) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-a9d1-0969-b976-008b.holly.idiocy.org. [2001:8b0:3f8:8129:a9d1:969:b976:8b]) by smtp.gmail.com with ESMTPSA id t186-v6sm3924784wmf.14.2018.08.04.09.19.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 Aug 2018 09:19:15 -0700 (PDT) Content-Disposition: inline In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::436 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:228166 Archived-At: On Wed, Jul 25, 2018 at 06:33:35PM +0900, YAMAMOTO Mitsuharu wrote: > > I suppose, to avoid changes in redisplay code, I could make the NS > > drawing functions detect whether they are running in the main thread > > (or perhaps they can just ask whether they’re able to draw or not), > > and if they’re not then invalidate the relevant rectangle, and if they > > are then do the actual drawing task. > > > > Then call display for each frame to force an expose ‘event’ at the end > > of redisplay. > > Back in early 2007, I privately experimented something like that > (without threading) with "modern Carbon" (HIWindow), where drawing > outside the "expose" callback was deprecated like the current > situation for Cocoa. I could actually find a platform-independent bug > that was otherwise difficult to find/reproduce > (http://lists.gnu.org/archive/html/emacs-devel/2007-04/msg01279.html) > by this experiment, but the overall performance was not quite > satisfactory then. So, I was surprised to see that (the "work" branch > of) the Mac port with the whole invalidation was "kinda usable" on > recent machines running Mojave. I’ve implemented this (without threading) and, like you say, the performance is pretty good. I can’t actually see any difference on my Mac. Unfortunately GNUstep is not as happy. It runs MUCH slower, to the extent that scrolling really doesn’t work at all. Turning off the menubar improves things, but not enough. Mind you, looking at the scrolling code again now, I think it’s forcing essentially the whole window to be redrawn anyway, so that won’t help. -- Alan Third