Skip to content

Slow startup due to reading a ton of font configuration files. #14

Description

@cizra

This version of st has a noticeable delay on startup.
strace -ttfo log ./st shows that something like 700 milliseconds is spent on walking through various places where my system stores fonts. Then it probably parses the XML or something.

From my config.h: static char font[] = "Terminus:pixelsize=14:antialias=false:autohint=false";

Here's an excerpt:

87498 22:54:36.287868 getrandom("\x7a\x94\x52\x5f\x6c\xf7\x0c\x4d", 8, 0) = 8
87498 22:54:36.287931 access("/etc/fonts/conf.d/10-yes-antialias.conf", R_OK) = 0
87498 22:54:36.287975 access("/etc/fonts/conf.d/10-yes-antialias.conf", R_OK) = 0
87498 22:54:36.288018 readlink("/etc/fonts/conf.d/10-yes-antialias.conf", "/usr/share/fontconfig/conf.defau"..., 4095) = 56
87498 22:54:36.288065 newfstatat(AT_FDCWD, "/usr/share/fontconfig/conf.default/10-yes-antialias.conf", {st_mode=S_IFREG|0644, st_size=258, ...}, 0) = 0
87498 22:54:36.288112 openat(AT_FDCWD, "/usr/share/fontconfig/conf.default/10-yes-antialias.conf", O_RDONLY|O_CLOEXEC) = 6
87498 22:54:36.288156 read(6, "<?xml version=\"1.0\"?>\n<!DOCTYPE "..., 8192) = 258
87498 22:54:36.288197 read(6, "", 8192) = 0
87498 22:54:36.288233 close(6)          = 0
87498 22:54:36.288271 getrandom("\x15\x42\xe6\xad\x38\x3c\xff\x4c", 8, 0) = 8
87498 22:54:36.288325 access("/etc/fonts/conf.d/11-lcdfilter-default.conf", R_OK) = 0
87498 22:54:36.288372 access("/etc/fonts/conf.d/11-lcdfilter-default.conf", R_OK) = 0
87498 22:54:36.288418 readlink("/etc/fonts/conf.d/11-lcdfilter-default.conf", "/usr/share/fontconfig/conf.defau"..., 4095) = 60
87498 22:54:36.288469 newfstatat(AT_FDCWD, "/usr/share/fontconfig/conf.default/11-lcdfilter-default.conf", {st_mode=S_IFREG|0644, st_size=695, ...}, 0) = 0
87498 22:54:36.288518 openat(AT_FDCWD, "/usr/share/fontconfig/conf.default/11-lcdfilter-default.conf", O_RDONLY|O_CLOEXEC) = 6
87498 22:54:36.288562 read(6, "<?xml version=\"1.0\"?>\n<!DOCTYPE "..., 8192) = 695
87498 22:54:36.288605 read(6, "", 8192) = 0
87498 22:54:36.288650 close(6)          = 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions