Skip to content

Conversation

@cgwalters
Copy link
Collaborator

build-sys: Add a link to rpm-ostree issue

Just to meke it easier to find.

Signed-off-by: Colin Walters [email protected]


tar/export: Only load root once

Minor optimization for previous commit.


Just to meke it easier to find.

Signed-off-by: Colin Walters <[email protected]>
Minor optimization for previous commit.

Signed-off-by: Colin Walters <[email protected]>
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request includes a comment update in bootc.spec and an optimization in ostree-ext/src/tar/export.rs to reduce redundant calls to read_commit. The changes are well-contained and improve performance.

fn write_parents_of(
&mut self,
path: &Utf8Path,
root: &gio::File,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Passing the root object here allows the function to resolve paths relative to the commit, avoiding redundant loading of the commit object in each recursive call.

Comment on lines 657 to +658

self.write_parents_of(parent, cache)?;
self.write_parents_of(parent, root, cache)?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

By passing the root, you've ensured that each recursive call uses the same root file, preventing redundant loads.

Comment on lines +733 to +736
let root = writer
.repo
.read_commit(&writer.commit_checksum, gio::Cancellable::NONE)?
.0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Moving the read_commit call here ensures that it's only called once per chunk, which reduces the number of calls to the repository.

@jeckersb jeckersb merged commit 9b72f1a into bootc-dev:main Jun 12, 2025
31 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants