From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: macOS metal rendering engine in mac port Date: Mon, 24 May 2021 15:47:15 +0300 Message-ID: <83eedwe1t8.fsf@gnu.org> References: <831r9xjrho.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8620"; mail-complaints-to="usenet@ciao.gmane.io" Cc: alan@idiocy.org, mituharu@math.s.chiba-u.ac.jp, emacs-devel@gnu.org To: Aaron Jensen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 24 14:49:03 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 1llA10-000202-Qu for ged-emacs-devel@m.gmane-mx.org; Mon, 24 May 2021 14:49:02 +0200 Original-Received: from localhost ([::1]:44490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llA0y-0007tR-Te for ged-emacs-devel@m.gmane-mx.org; Mon, 24 May 2021 08:49:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48414) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ll9zP-0005FK-UA for emacs-devel@gnu.org; Mon, 24 May 2021 08:47:23 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:36312) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ll9zM-0007X4-Si; Mon, 24 May 2021 08:47:20 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3906 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ll9zM-00021n-Br; Mon, 24 May 2021 08:47:20 -0400 In-Reply-To: (message from Aaron Jensen on Sun, 23 May 2021 20:56:08 -0700) 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:269752 Archived-At: > From: Aaron Jensen > Date: Sun, 23 May 2021 20:56:08 -0700 > Cc: Alan Third , emacs-devel@gnu.org, > YAMAMOTO Mitsuharu > > Here are some interesting profile pictures. On the left is emacs -Q w/ > display-line-numbers-mode. On the right is a partial version of my > config with some of the things I mentioned before removed. Most of the > difference between the two comes in the amount of time spent in > merge_faces. My config ends up spending roughly 7.5x more time in > merge_faces (1500ms vs 200ms). What causes that to get slower? Some observations about these profiles: First, given the non-repeatability of the benchmarks whose data you exchanged with Alan, I'm not sure we should trust these profiles. More importantly, look at the percentage: you are showing only a part of the CPU usage. In the case of the upper image, a relatively small part: 17% in the left case, 27% in the right case. The rest, which is the bulk of the CPU usage, is under Fredisplay, and is not expanded, so we don't see what takes most of the time there. Suppose we reduce the CPU usage of maybe_produce_line_number and merge_faces to zero: that would still leave 70 to 80 percent of runtime. So it's important to look at the fully expanded profile. The lower pair of profiles is even more puzzling. Look at the expansion of Fredisplay: it in effect tells me that try_window, a function that redisplays a complete window, and its workhorse display_line (which displays a full screen line) spend 100% of their time inside maybe_produce_line_number, and the rest of their code takes 0% of CPU! This simply cannot be true, since display of the line numbers is just a small part of what needs to be done for redisplaying a window. So I don't really understand how to interpret these profiles. Thanks.