Skip to content

perf(dracut-functions): optimize inst_libdir_file()#2353

Open
aafeijoo-suse wants to merge 1 commit into
dracut-ng:mainfrom
aafeijoo-suse:inst_perf2
Open

perf(dracut-functions): optimize inst_libdir_file()#2353
aafeijoo-suse wants to merge 1 commit into
dracut-ng:mainfrom
aafeijoo-suse:inst_perf2

Conversation

@aafeijoo-suse
Copy link
Copy Markdown
Contributor

Let's start analyzing the output of a non-hostonly build, focusing on the inst_libdir_file() calls:

$ dracut -f -N --debug testn.img 2>&1 &> testn.txt
$ grep -r -c "(inst_libdir_file): inst_multiple" testn.txt
17
$ grep -r "(inst_libdir_file): inst_multiple" testn.txt | awk -F"inst_multiple " '{ print $2 }' | tr ' ' '\n' | sort | wc -l
295
$ grep -r "(inst_libdir_file): inst_multiple" testn.txt | awk -F"inst_multiple " '{ print $2 }' | tr ' ' '\n' | sort -u | wc -l
201

There are 94 files that are attempted to be installed multiple times. After adding a simple cache:

$ grep -r -c "(inst_libdir_file): inst_multiple" testn2.txt
13
$ grep -r "(inst_libdir_file): inst_multiple" testn2.txt | awk -F"inst_multiple " '{ print $2 }' | tr ' ' '\n' | sort | wc -l
201

Checklist

  • I have tested it locally
  • I have reviewed and updated any documentation if relevant
  • I am providing new code and test(s) for it

@aafeijoo-suse aafeijoo-suse requested a review from a team as a code owner April 7, 2026 15:22
Let's start analyzing the output of a non-hostonly build, focusing on the
`inst_libdir_file()` calls:

```
$ dracut -f -N --debug testn.img 2>&1 &> testn.txt
$ grep -r -c "(inst_libdir_file): inst_multiple" testn.txt
17
$ grep -r "(inst_libdir_file): inst_multiple" testn.txt | awk -F"inst_multiple " '{ print $2 }' | tr ' ' '\n' | sort | wc -l
295
$ grep -r "(inst_libdir_file): inst_multiple" testn.txt | awk -F"inst_multiple " '{ print $2 }' | tr ' ' '\n' | sort -u | wc -l
201
```

There are 94 files that are attempted to be installed multiple times. After
adding a simple cache:

```
$ grep -r -c "(inst_libdir_file): inst_multiple" testn2.txt
13
$ grep -r "(inst_libdir_file): inst_multiple" testn2.txt | awk -F"inst_multiple " '{ print $2 }' | tr ' ' '\n' | sort | wc -l
201
```
@github-actions github-actions Bot added the test Issues related to testing label Apr 8, 2026
@Conan-Kudo Conan-Kudo enabled auto-merge (rebase) April 10, 2026 10:49
@bdrung
Copy link
Copy Markdown
Member

bdrung commented Apr 10, 2026

I would prefer to aim for a bigger improvement: Instead of caching on individual file level, I would go one step further for #1419: Add staging functions similar to the inst_* functions. These functions would just collect what should be added. Then call an dracut-intsall equivalent to only write a manifest for 3cpio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test Issues related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants