Bug 278840 - editors/emacs severely lagging on Font Awesome glyphs
Summary: editors/emacs severely lagging on Font Awesome glyphs
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Joseph Mingrone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-07 18:33 UTC by Zeus Panchenko
Modified: 2024-05-20 17:14 UTC (History)
2 users (show)

See Also:


Attachments
pkg info emacs (3.12 KB, text/plain)
2024-05-07 18:46 UTC, Zeus Panchenko
no flags Details
pkg info -a (45.47 KB, text/plain)
2024-05-07 18:47 UTC, Zeus Panchenko
no flags Details
fc-cache -fv (7.21 KB, text/plain)
2024-05-07 18:48 UTC, Zeus Panchenko
no flags Details
fc-list -v (252.39 KB, application/x-xz)
2024-05-08 05:27 UTC, Zeus Panchenko
no flags Details
pkg info emacs output (3.63 KB, text/plain)
2024-05-08 15:54 UTC, Joseph Mingrone
no flags Details
i3status config file (2.80 KB, text/plain)
2024-05-10 16:18 UTC, Zeus Panchenko
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zeus Panchenko 2024-05-07 18:33:47 UTC
editors/emacs v29.3,3 GUI is severely lagging if file contains Font Awesome 6 glyphs, TUI isn't affected 

Font Awesome .otf files are installed into ~/.fonts
Comment 1 Zeus Panchenko 2024-05-07 18:37:19 UTC
another observation:

1. copy one unicode character from

https://en.wikipedia.org/wiki/Enclosed_Alphanumeric_Supplement

(particularly 🅉)

2. paste in emacs and have a lag
Comment 2 Zeus Panchenko 2024-05-07 18:46:33 UTC
Created attachment 250518 [details]
pkg info emacs
Comment 3 Zeus Panchenko 2024-05-07 18:47:21 UTC
Created attachment 250519 [details]
pkg info -a
Comment 4 Zeus Panchenko 2024-05-07 18:48:10 UTC
Created attachment 250520 [details]
fc-cache -fv
Comment 5 Zeus Panchenko 2024-05-08 05:27:55 UTC
Created attachment 250523 [details]
fc-list -v
Comment 6 Joseph Mingrone freebsd_committer freebsd_triage 2024-05-08 15:54:36 UTC
Created attachment 250533 [details]
pkg info emacs output
Comment 7 Joseph Mingrone freebsd_committer freebsd_triage 2024-05-08 16:05:17 UTC
Thanks for the report.  I had seen problems with lag when selecting and yanking text in the past.  It will be helpful to get a reliable recipe to reproduce this.  So far I'm unable to trigger the problem.

Here is what I did.

1. Configure Emacs as you have.

See my 'pkg info emacs output' attachment.

2. Install the Font Awesome fonts.

% ls -lah ~/.fonts
total 1175
drwxr-xr-x   2 jrm jrm    5B May  8 12:29 .
drwxr-xr-x  26 jrm jrm   77B May  8 12:44 ..
-rw-r--r--   1 jrm jrm  545K Apr  2 14:32 Font Awesome 6 Brands-Regular-400.otf
-rw-r--r--   1 jrm jrm  185K Apr  2 14:32 Font Awesome 6 Free-Regular-400.otf
-rw-r--r--   1 jrm jrm  1.0M Apr  2 14:32 Font Awesome 6 Free-Solid-900.otf

3. Run `fc-cache -fv` and verify the fonts are found.

% fc-list | grep Awesome
/home/jrm/.fonts/Font Awesome 6 Free-Solid-900.otf: Font Awesome 6 Free,Font Awesome 6 Free Solid:style=Solid
/home/jrm/.fonts/Font Awesome 6 Brands-Regular-400.otf: Font Awesome 6 Brands,Font Awesome 6 Brands Regular:style=Regular
/home/jrm/.fonts/Font Awesome 6 Free-Regular-400.otf: Font Awesome 6 Free,Font Awesome 6 Free Regular:style=Regular

4. emacs -Q

5. Yank 🅉 and yank lots of text, but I don't see any lagging.  Here is a video.  https://youtu.be/6Umrua9vkew

Please let me know if you see anything I'm missing to trigger the problem.
Comment 8 Zeus Panchenko 2024-05-10 16:17:46 UTC
that character doesn't belong to Font Awesome glyphs, it's another issue with just UTF

as for Font Awesome it looks some definite glyph causes the problem or set of glyphs ... 

I'm attaching my i3status config file which guarantees lagging for me (I've just checked that out on a fresh FBSD 14 installation)
Comment 9 Zeus Panchenko 2024-05-10 16:18:23 UTC
Created attachment 250568 [details]
i3status config file
Comment 10 Joseph Mingrone freebsd_committer freebsd_triage 2024-05-10 17:24:21 UTC
I used the character, 🅉, that you said caused lag in Comment 1.

Just now, I tried taking characters from your i3 config that belong to Font Awesome glyphs, but I still don't see lag.

https://youtu.be/vziAaC_Zxbo

I also tried running i3 by installing the i3 and i3status packages and moving your config to ~/.i3/config, but i3 complains about errors in the config.  https://photos.app.goo.gl/fFKSFXtq6qiT5Ffy7
Comment 11 Zeus Panchenko 2024-05-14 17:09:49 UTC
config I provided is i3status config file, not i3 config file

use i3 default config file instead

use my i3status config file as config only for i3status (put it into ~/.i3status/config)

I find it weird though ... when I open the file in my emacs, the process (of emacs) loads one CPU core to full 100% ... (recently I've tested that again on a fresh system)
Comment 12 Zeus Panchenko 2024-05-20 17:14:57 UTC
while trying to truss(1) emacs process during that CPU 100% load, I found that it's trying to do something with google fonts

 1908: 25.606515682 timerfd_settime(0x3,0x1,0x82082e190,0x0) = 0 (0x0)
 1908: 25.606535815 sigprocmask(SIG_SETMASK,{ },0x0) = 0 (0x0)
 1908: 25.828189445 access("/usr/local/share/fonts/google-fonts/AdobeBlank-Regular.ttf",R_OK) = 0 (0x0)
 1908: 26.050683874 access("/usr/local/share/fonts/google-fonts/AdobeBlank-Regular.ttf",R_OK) = 0 (0x0)
 1908: 26.272855080 access("/usr/local/share/fonts/google-fonts/AdobeBlank-Regular.ttf",R_OK) = 0 (0x0)
 1908: 26.495131605 access("/usr/local/share/fonts/google-fonts/AdobeBlank-Regular.ttf",R_OK) = 0 (0x0)
 1908: 26.716650534 access("/usr/local/share/fonts/google-fonts/AdobeBlank-Regular.ttf",R_OK) = 0 (0x0)
 1908: 26.937682931 access("/usr/local/share/fonts/google-fonts/AdobeBlank-Regular.ttf",R_OK) = 0 (0x0)
 1908: 27.162007168 access("/usr/local/share/fonts/google-fonts/AdobeBlank-Regular.ttf",R_OK) = 0 (0x0)
 1908: 27.384357588 access("/usr/local/share/fonts/google-fonts/AdobeBlank-Regular.ttf",R_OK) = 0 (0x0)
 1908: 27.606626679 SIGNAL 14 (SIGALRM) code=SI_TIMER value=0xa23308 timerid=3 overrun=0
 1908: 27.606663801 sigprocmask(SIG_SETMASK,{ SIGINT|SIGQUIT|SIGALRM|SIGCHLD|SIGIO|SIGPROF|SIGWINCH },0x0) = 0 (0x0)
 1908: 27.606686237 sigreturn(0x82082d2c0)	 EJUSTRETURN
 1908: 27.607992112 access("/usr/local/share/fonts/google-fonts/AdobeBlank-Regular.ttf",R_OK) = 0 (0x0)
 1908: 27.608021962 recvmsg(5,0x82082de50,0)	 ERR#35 'Resource temporarily unavailable'
 1908: 27.608043689 recvmsg(5,0x82082de90,0)	 ERR#35 'Resource temporarily unavailable'
 1908: 27.608072748 poll({ 5/POLLIN 6/POLLIN 8/POLLIN },3,0) = 0 (0x0)
 1908: 27.608095519 sigprocmask(SIG_BLOCK,{ SIGINT|SIGALRM },{ }) = 0 (0x0)
 1908: 27.608118005 ktimer_settime(0x3,0x1,0x82082e190,0x0) = 0 (0x0)
 1908: 27.608138752 timerfd_settime(0x3,0x1,0x82082e190,0x0) = 0 (0x0)
 1908: 27.608159747 sigprocmask(SIG_SETMASK,{ },0x0) = 0 (0x0)
 1908: 27.830379481 access("/usr/local/share/fonts/google-fonts/AdobeBlank-Regular.ttf",R_OK) = 0 (0x0)
 1908: 28.053440456 access("/usr/local/share/fonts/google-fonts/AdobeBlank-Regular.ttf",R_OK) = 0 (0x0)
 1908: 28.274900561 access("/usr/local/share/fonts/google-fonts/AdobeBlank-Regular.ttf",R_OK) = 0 (0x0)
 1908: 28.497347947 access("/usr/local/share/fonts/google-fonts/AdobeBlank-Regular.ttf",R_OK) = 0 (0x0)
 1908: 28.719807010 access("/usr/local/share/fonts/google-fonts/AdobeBlank-Regular.ttf",R_OK) = 0 (0x0)
 1908: 28.940941392 access("/usr/local/share/fonts/google-fonts/AdobeBlank-Regular.ttf",R_OK) = 0 (0x0)
 1908: 29.164271136 access("/usr/local/share/fonts/google-fonts/AdobeBlank-Regular.ttf",R_OK) = 0 (0x0)
 1908: 29.387565109 access("/usr/local/share/fonts/google-fonts/AdobeBlank-Regular.ttf",R_OK) = 0 (0x0)
 1908: 29.610230465 SIGNAL 14 (SIGALRM) code=SI_TIMER value=0xa23308 timerid=3 overrun=0
 1908: 29.610266358 sigprocmask(SIG_SETMASK,{ SIGINT|SIGQUIT|SIGALRM|SIGCHLD|SIGIO|SIGPROF|SIGWINCH },0x0) = 0 (0x0)
 1908: 29.610288643 sigreturn(0x82082d2c0)	 EJUSTRETURN
 1908: 29.611598523 access("/usr/local/share/fonts/google-fonts/AdobeBlank-Regular.ttf",R_OK) = 0 (0x0)
 1908: 29.611629636 recvmsg(5,0x82082de50,0)	 ERR#35 'Resource temporarily unavailable'



so, I uninstalled x11-fonts/google-fonts and now I don't observe the laggs