Subject: bug#73563: [Ben Simms] Performance bottleneck in ns_draw_fringe_bitmap

From: Eli Zaretskii <[email-masked]>
Date: Mon, 30 Sep 2024 15:26:31 +0300

> Cc: Ben Simms <[email-masked]>
> From: Stefan Kangas <[email-masked]>
> 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?