Following the "The Emacs master is much slower than the emacs-27
branch." thread, I tested Alan's benchmark on the master branch. The
platform I used is a 64-bit GNU/Linux computer, with GCC 10.2.
It turns out that the 10-15% slowdown of redisplay in Emacs 28,
compared to Emacs 27, is due to a single character change, namely the
"!" character removed in commit 165fd028.
That sounds rather odd, because the code in question is this:
for (img = c->buckets[i]; img; img = img->next)
if (img->hash == hash
&& equal_lists (img->spec, spec)
And the ! removed was in front of the equal_list (which was reversed
logically).
In comparison, the code looks like this in Emacs 27:
for (img = c->buckets[i]; img; img = img->next)
if (img->hash == hash
&& !NILP (Fequal (img->spec, spec))