]> git.ipfire.org Git - thirdparty/elfutils.git/commit
readelf.c: Avoid repeating calls to gettext _() in hotpath
authorAaron Merey <amerey@redhat.com>
Mon, 22 Sep 2025 01:30:17 +0000 (21:30 -0400)
committerAaron Merey <amerey@redhat.com>
Mon, 6 Oct 2025 01:30:07 +0000 (21:30 -0400)
commit12edf47163741e76eb3bfb0084e14d1124197528
tree9c29278286a407d245314532f42167654f341437
parent9ea76de8a2c70e14dc450877f4347afcf4a63bae
readelf.c: Avoid repeating calls to gettext _() in hotpath

Calls to the gettext _() macro in hotpaths results in unnecessary lookups
of the same translation strings during runtime.

Avoid this performance cost by calling _() for hotpath strings just once
and storing the results.  Runtime speedup of up to 17% has been observed
with this patch applied.

Signed-off-by: Aaron Merey <amerey@redhat.com>
src/readelf.c