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.bugs Subject: bug#73563: [Ben Simms] Performance bottleneck in ns_draw_fringe_bitmap Date: Mon, 30 Sep 2024 15:26:31 +0300 Message-ID: <86plol2uq0.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32331"; mail-complaints-to="usenet@ciao.gmane.io" Cc: ben@bensimms.moe, 73563@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 30 14:27:43 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1svFV9-0008Gl-8Q for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 30 Sep 2024 14:27:43 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1svFUx-0000Pk-5a; Mon, 30 Sep 2024 08:27:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1svFUv-0000MX-NW for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2024 08:27:29 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1svFUv-0002z9-Ef for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2024 08:27:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=sgpgEVTf7WdE1Nl18d8mqVd6+UV3/Hl+BxkoNBW23GM=; b=prv+v3ReJE2Q+mxtuZHyllsnHQNgzuHcWfZxXqBvuxd3Dr5jmFa4VgvqtUCu+De9YYqOg3xZ21GD4wqCqmfPS+1NkfJ4GQp6V/devoe+QW00LzGOoRPjYU6y00fOQyM9gqIAalmIi483W6/+stabw3AcjVy57mnhccof9XBX6o12jh8wJACBfCfv5C6puxrS5e5YFwbpeed8yMbIOqpx0MCq4eEzVh4ge/SLZo/mfr+5qF2pp5aC4hdIOVUkC7V08a4rOrYd3VIcNKiDcP27T4sVmhr3HMyy2qb4WetGlpooKGyu8arqDZVNnO+YIKGfA+VKAajeKtFepUuooOSzAQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1svFVS-0007qK-2D for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2024 08:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 Sep 2024 12:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73563 X-GNU-PR-Package: emacs Original-Received: via spool by 73563-submit@debbugs.gnu.org id=B73563.172769923729746 (code B ref 73563); Mon, 30 Sep 2024 12:28:02 +0000 Original-Received: (at 73563) by debbugs.gnu.org; 30 Sep 2024 12:27:17 +0000 Original-Received: from localhost ([127.0.0.1]:44931 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svFUi-0007jh-JB for submit@debbugs.gnu.org; Mon, 30 Sep 2024 08:27:16 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41966) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svFUg-0007jB-JQ for 73563@debbugs.gnu.org; Mon, 30 Sep 2024 08:27:15 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1svFU3-0002rx-K5; Mon, 30 Sep 2024 08:26:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=sgpgEVTf7WdE1Nl18d8mqVd6+UV3/Hl+BxkoNBW23GM=; b=lCnMA+IuibSp S12j3lTimeBAZKSIy4XBj99Cp37SCkMxfiZzkXoxDZawJ/yhHW9RLplEzuPU79rCER0SNHCm3XEsC qxVYJ8qkB/mzedk404dhI7zQHJkadK942uRsyJkaRCVl92RNGs1hHBdmESeT5Fe74FxHNs27L6EuY 4WbENr0pLyLYlUu+q0HERvyhk/tZ55O+6IRavr514I7cO+lREEGzBVoi4Ej6GUasZZaz3jEspjtZ4 AQ+hzFltD2ab1o5bbDIAUS1Y1S842XZfALIoFj2HEUFhU+sobwjlhyOoeZaH2vUpuVIeUoQqEGibe kNbME89h/vTu5BYx876zbQ==; In-Reply-To: (message from Stefan Kangas on Mon, 30 Sep 2024 07:21:03 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:292708 Archived-At: > Cc: Ben Simms > From: Stefan Kangas > Date: Mon, 30 Sep 2024 07:21:03 +0000 > > Hi all, I recently started using Emacs (ns) HEAD on an ARM macos sonoma > system. > > I've noticed that ns_draw_fringe_bitmap is a fairly large performance sink > when using pixel scrolling (to the point of 99% of cpu time being inside this > function, with Emacs drawing at approx 5Hz). The slowness here isn't as > obvious when not pixel scrolling, presumably because Emacs never tries to > redraw at 60+Hz otherwise. > > I have performed some profiling and discovered that in my observed worse case > situation, of the 99% of cpu time spent in ns_draw_fringe_bitmap, approx 50% > is spent in [NSBezierPath copy], and approx 30% in [NSBezierPath fill]. According to the posted profile, ns_draw_fringe_bitmap takes much less than 99% of CPU time, somewhere around 10%. What am I missing?