nixos/systemd-boot-builder: cache boot_path()

It calls Path.resolve() and is invoked several times per generation for
the same store paths.
This commit is contained in:
r-vdp
2026-06-02 12:20:53 +03:00
parent 85d59c4f3d
commit 820d20f8b9
@@ -3,6 +3,7 @@ import argparse
import ctypes
import datetime
import errno
import functools
import hashlib
import os
import re
@@ -330,6 +331,7 @@ def bootspec_from_json(bootspec_json: dict[str, Any]) -> BootSpec:
)
@functools.lru_cache(maxsize=None)
def boot_path(file: Path) -> Path:
store_file_path = file.resolve()
suffix = store_file_path.name