From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Aaron Jensen Newsgroups: gmane.emacs.devel Subject: Re: macOS metal rendering engine in mac port Date: Tue, 25 May 2021 08:35:42 -0700 Message-ID: References: <5754E85B-9840-416B-B9C1-E6B2B1FC0114@gnu.org> <80A25FCA-2CF4-433F-B82F-4B37ED5BC6DC@gnu.org> <831r9wdrjr.fsf@gnu.org> <83v978ccbc.fsf@gnu.org> <83sg2cc8m7.fsf@gnu.org> <83pmxgc681.fsf@gnu.org> <83mtskc4zl.fsf@gnu.org> <83lf84c4p7.fsf@gnu.org> <83k0nncznr.fsf@gnu.org> <279F3242-E556-42C9-8489-4DD8F538938E@gnu.org> <83bl8zc8ku.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23269"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Alan Third , YAMAMOTO Mitsuharu , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 25 18:55:49 2021 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 1llaLM-0005oC-E7 for ged-emacs-devel@m.gmane-mx.org; Tue, 25 May 2021 18:55:48 +0200 Original-Received: from localhost ([::1]:54038 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llaLL-0002R5-E9 for ged-emacs-devel@m.gmane-mx.org; Tue, 25 May 2021 12:55:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39362) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llZ6A-0003oh-Fh for emacs-devel@gnu.org; Tue, 25 May 2021 11:36:02 -0400 Original-Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]:45889) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llZ64-0006Xl-Q1; Tue, 25 May 2021 11:36:00 -0400 Original-Received: by mail-pj1-x102f.google.com with SMTP id ne24-20020a17090b3758b029015f2dafecb0so12220475pjb.4; Tue, 25 May 2021 08:35:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4csm33iVJurZQhs2irwSCKfeH32S+906pBfg5o8zekk=; b=il1fy8fOuuEE/zKWO/IkilkB/fpi+QZF5s+K2PsNK+Gdwk7j0TspLHJ5+wI7M+iW99 Qt8Da1qv3+V1SwkLwsSlFmaHZBb0ThkctE8osqswuxWhFPuLrEbLZ0W8mh+HAvm8eVZg zXBNue5vdgdKFixt9QzncPTAdE5Wid8pC4mojkOZv3Jj+6swc3vk8iggKfTLilU4329Y 7nwRn/m8b7nVudYcTCkTcTG8PzUCPnCUrNC8IcQqITNlMfCMVz2pkriIYhX9eGucGK2O MxJWrVow6cc4o6xAU8G5ZPO42w3vQ+9jsRKMGPxzCTpGavlL/qe1VaWUR3ATpe9eES2J W/QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4csm33iVJurZQhs2irwSCKfeH32S+906pBfg5o8zekk=; b=LumG6bnBz1YCUXEIMiroxU+9P+SCdVUCpnof0SxEBOk1iN37jJV6ZFPbouERR/4mwv JT3qre0w75X/unPHXqHeKV1gKyc/rMyGKyBu/Y3pvEzQQ513WvhUGpN1PzOM1Xqw+Gx1 T+WHWuGE9xqf0EG1ze00sv7zayV7BwayB/yFBWxXY/ncZedNV1IGPsVLjoxs2ck1dDKF twR2DhJ12kILonTvm7iF1zyh+mCpi6Z7vC/Go8+oTIGhEbt8J136GVggO7SYFqEh/bzi LEzsUh2m99IEQs/BXgcZXhhuY1Ls2pjg0tUC4lLS8EYlXXp1xLO00T2JYItVVxtVXMVF RGwQ== X-Gm-Message-State: AOAM532xTb9e0M5C96C+DE2xr6a3/uQqCnYpd6neLW5+18mqUcscab2j 22WhsPffqSQbnbseHv6wQQ9sqbzgydDJ9k2yd1MSNH4giPYUcQ== X-Google-Smtp-Source: ABdhPJwitGFHDnV4/dcWoYxpPSGvzmKd0tAPSmLuW4BQo1UzZTvGMUUo8Su3JPAEcrOdxpL7JhYfxjyWvWmY/df8z44= X-Received: by 2002:a17:902:b412:b029:ef:1737:ed with SMTP id x18-20020a170902b412b02900ef173700edmr31533498plr.43.1621956953764; Tue, 25 May 2021 08:35:53 -0700 (PDT) In-Reply-To: <83bl8zc8ku.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=aaronjensen@gmail.com; helo=mail-pj1-x102f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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:269862 Archived-At: On Tue, May 25, 2021 at 5:16 AM Eli Zaretskii wrote: > > > From: Aaron Jensen > > Date: Mon, 24 May 2021 23:26:37 -0700 > > Cc: emacs-devel@gnu.org, Alan Third , > > YAMAMOTO Mitsuharu > > > > > > Alan, I could understand why drawing glyphs would take longer (there's > > > > more to draw when there are line numbers), > > > > > > ??? Because line numbers add ~3 glyphs to each line? How can this explain any significant slowdown? Do you see something similar if you add 3 characters to every line and benchmark the scroll? > > > > I added 3 characters to the end of every line of xdisp.c (//1) and it > > went from 7.2s to 8.4s -- 17% (emacs -Q, no line numbers). > > The 17% is about twice what I'd expect, since adding 3 characters to > each line of xdisp.c enlarges its text by only 9.3%. Pure guess here, but it's also making a lot of empty lines non-empty (14% more). Perhaps that has an added cost somehow? > > The timing differences are primarily in display_line. gui_write_glyphs > > is 15% slower, which is nowhere near 576ms. Profile attached. > > > > That certainly doesn't match the 78% slower for drawing glyphs in the > > line number scenario. > > > > Any suggestions on what to try next? > > The numbers are so against my intuition that I'm not even sure in > which direction to think... > > How did you compile Emacs? which compiler and what compiler and linker > switches? And what kind of CPU do you have there? I'm looking for > something that could explain why parts of code that should take like > 20% of the total redisplay time are so dominant in your case. clang, with -O2. Specifically these configure flags: CFLAGS="-g3 -O2" \ --disable-silent-rules \ --with-xml2 \ --with-gnutls \ --without-dbus \ --with-imagemagick \ --with-modules \ --with-rsvg \ --with-ns \ --disable-ns-self-contained This CPU: Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz > > Alan, do you see similar numbers (in percents) to what Aaron reports? > Or is that something peculiar to his system? What I get depends on frame size and whether or not I'm using nativecomp or Alan's branch or master. I just a test with a smaller frame size (on Alan's branch this time, just happens to be what I have built) and saw 5.58 vs 6.8s: 22%. But then I ran the bench again w/ line numbers and couldn't get it below 7.2s, so there's quite a bit of variability in the test runs. Alan, I haven't forgotten about your question about latency and that additional patch. I'm using that patch now and will work with it through the day.