]> git.ipfire.org Git - thirdparty/systemd.git/commit
shared/install: optionally cache the preset list
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 30 Apr 2020 20:37:34 +0000 (22:37 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 5 May 2020 19:50:31 +0000 (21:50 +0200)
commit8f7b256665a3e6d154e8f1987e2b79c723c761ad
tree9b127d9e1ec2c5402cb0dd59844dd47d1508b350
parentc39b7821f6d24d0b096ee347c6e1e2708391438f
shared/install: optionally cache the preset list

When doing list-unit-files with --root, we would re-read the preset
list for every unit. This uses a cache to only do it once. The time
for list-unit-files goes down by about ~30%.

unit_file_query_preset() is also called from src/core/. This patch does not
touch that path, since the saving there are smaller, since preset status is
only read on demand over dbus, and caching would be more complicated.
src/core/unit.c
src/shared/install.c
src/shared/install.h
src/systemctl/systemctl.c