]> git.ipfire.org Git - thirdparty/systemd.git/commit
properties: Skip value building for nominal case 43146/head
authorChris Down <chris@chrisdown.name>
Fri, 24 Jul 2026 23:18:27 +0000 (16:18 -0700)
committerChris Down <chris@chrisdown.name>
Sat, 1 Aug 2026 07:53:16 +0000 (00:53 -0700)
commit248d6cf09d26a2daeff20c29fb1660868b9d352b
tree1910370588782fd83b4717d1be902a423ace3cb6
parent5663ddaed7f7d89236cf0ef4a634c3828518108c
properties: Skip value building for nominal case

bus_message_print_all_properties() builds a PROP= string for every
property in the reply so that -p PROP=value filters can be matched
against it, but most queries never need this.

Take the normal `systemctl show` or `systemctl show UNIT` case. In that
case there is no filter. Even with `-p PROP` there is no value filter
since there is no value.

Avoid constructing the string entirely by comparing property names
directly against filter entries.

In my tests with a `systemctl show` over 160 units this brings the
instructions retired from 992.6M down to 960.5M, a reduction of 3.2%.

The same goes for property filters with units. When running:

    systemctl show -p UnitFileState -p ActiveState UNIT

...the instructions retired drops from 9.52M to 9.22M, a reduction of
3.2%. The output in each case is unchanged.
src/shared/bus-print-properties.c