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: Fri, 21 May 2021 08:27:14 -0700 Message-ID: References: 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="17499"; mail-complaints-to="usenet@ciao.gmane.io" To: Alan Third , Aaron Jensen , emacs-devel@gnu.org, YAMAMOTO Mitsuharu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri May 21 17:28:21 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 1lk74X-0004Hx-D8 for ged-emacs-devel@m.gmane-mx.org; Fri, 21 May 2021 17:28:21 +0200 Original-Received: from localhost ([::1]:38294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lk74V-0002sI-Hy for ged-emacs-devel@m.gmane-mx.org; Fri, 21 May 2021 11:28:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34950) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lk73g-0002Bn-7B for emacs-devel@gnu.org; Fri, 21 May 2021 11:27:28 -0400 Original-Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]:42810) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lk73e-00075k-Kx for emacs-devel@gnu.org; Fri, 21 May 2021 11:27:28 -0400 Original-Received: by mail-pl1-x633.google.com with SMTP id v13so11148312ple.9 for ; Fri, 21 May 2021 08:27:26 -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; bh=aZiNzR6tMOqo41SdGGBi1jSbS+AKFvzNJjFQ9LEu5og=; b=TRTZCfHazkQN7nXQsqkmnY3uvcJgkFTj4N5VGqEqTD2O5R6jVAuiyDCH6Z2UAbcRSE 6P7KKnlVK48kOL8wWs9C55AWG1nvBDAjFGTDW59U1Q9JHehXzM8MBjBURrgAlBUmqACV sVSoIqfVOf6YJYeyuu2AnfWLd11ofMTjtu/H4uLz4K9DFWn7Ac1p4xmSwQt3iFiJzDbB tX55X/BAhjKJ1OrrWnGJHlYYheeiC+CYluBIwAPM/PqajdpOS9zKGRbQi/OmU49sMkJE TZ2P+gwIMqi808Gr3VzhVJthJf3Gt5ax3viqI895wI4gPpSEyOMBFWqzqkIwMaIB4qiJ URLw== 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; bh=aZiNzR6tMOqo41SdGGBi1jSbS+AKFvzNJjFQ9LEu5og=; b=b3Vu1wq753KXPv8NL+pfjIWq9IS9uCk53qFV7dhrEl1W0FqhWTdwkNm+enoEAveTQv +zrE9Z7UQtyMxx2ALLxwoVjBbHYCtOIBfqhpEY2YAIfzcwgjmml+WtauyQ3T9eaiqxfA DUDlGuafWz4OdyfEWgi5i74KQ+Dymg/zl4a2Pf3tLIFtvzdN0JoM0vO3NpOD8FnvcAiW I1EdV6w7DDn0QnL2NtU67SFgJkHALXUCollmYbQfRQKJflfOFdvTrgveqNilGj4F23J0 XaHmFibsEvFTJz823Ab4wRYMXuh9oSESTiCoQSXbqyr8966RcBo71nPx+y20NrjtiFLL NCeA== X-Gm-Message-State: AOAM533AYvQijBld+/Qrx5QeKfJaR/z6RoYWhMBNnHTEg4H024Kfyg26 SG5gOK5GWvobvcIgMKMX4Y85XM4k2J5v82G7ZIg= X-Google-Smtp-Source: ABdhPJwV6TnGMQRWoWzoYo7y349peMv42tKAbMLn0X+cD+NSFYwR8DJWnamDF7O9woERebF4lgZs+vttH9VrtnakulM= X-Received: by 2002:a17:90a:1b09:: with SMTP id q9mr11613280pjq.108.1621610845252; Fri, 21 May 2021 08:27:25 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=aaronjensen@gmail.com; helo=mail-pl1-x633.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:269566 Archived-At: On Fri, May 21, 2021 at 12:35 AM Alan Third wrote: > > Out of interest, is it the metal renderer making the difference, or is > the Mac port just better anyway? > > I only ask because on my Mac enabling metal rendering results in a > *much* lower frame rate (although whether that equates to higher input > lag I don't know). Pressing and holding a key for 10s with a high key repeat rate: Large frame: NS: 300 letters input Macport: 530 letters input Macport with metal: 515 letters input Smaller frame: NS: 583 letters input Macport: 599 letters input Macport with metal: 595 letters input Scrolling one line at a time with a high key repeat rate: Large frame: NS: 187 lines scrolled Macport: 248 lines scrolled Macport with metal: 171 lines scrolled Smaller frame: NS: 399 lines scrolled Macport: 456 lines scrolled Macport with meta: 338 lines scrolled So yes, it appears that the macport without metal is actually faster on my machine which is surprising. How do you typically measure framerate? That said, I have an app on my phone called "Is it snappy" that uses the high speed camera to attempt to measure input latency. With my full config measuring the input latency I get: Large frame: NS: 95.8 100.0 107.9 (101.2 ms avg) Macport: 100.0 95.4 95.8 (97.1 ms avg) Macport with Metal: 78.7 87.5 99.6 (88.6 ms avg) Smaller frame (only one trial of each of these): NS: 82.9 ms Macport: 87.5 ms Metal: 70.8 ms > > > I'm curious if now might be a good time to consider bringing over at least > > this rendering engine from the mac port and making it a part of Emacs > > proper. I'm not familiar with all of the reasons for keeping the mac port > > separate so maybe this whole thing is a non-starter, but I wanted to raise > > it because it's a real quality of life improvement on larger/higher dpi > > screens. > > At that level the two ports don't really look alike, so it's not like > it's just a case of copying the relevant code over. > > What might be helpful is to profile to find out what's slowing the NS > port down. Can I profile with XCode? What debug optimization level do I have to use to make it useful? Aaron