Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use libsolv repo cache #67

Merged
merged 4 commits into from
Aug 14, 2019
Merged

Use libsolv repo cache #67

merged 4 commits into from
Aug 14, 2019

Conversation

r4f4
Copy link
Collaborator

@r4f4 r4f4 commented May 24, 2019

Command:

$: G_MESSAGES_DEBUG= time ./fus -r modular,normal,https://ftp.icm.edu.pl/pub/Linux/fedora/linux/releases/30/Modular/x86_64/os/ -r pkgs,normal,https://ftp.icm.edu.pl/pub/Linux/fedora/linux/releases/30/Everything/x86_64/os/ -a x86_64 libmodulemd

Before: downloading metadata
11.88user 1.02system 0:42.10elapsed 30%CPU (0avgtext+0avgdata 374312maxresident)k 40inputs+128680outputs (1major+142867minor)pagefaults 0swaps
Before: cached metadata
11.28user 0.23system 0:12.17elapsed 94%CPU (0avgtext+0avgdata 391584maxresident)k 0inputs+32outputs (0major+156295minor)pagefaults 0swaps

After: downloading metadata & saving repo cache
14.81user 1.22system 0:48.40elapsed 33%CPU (0avgtext+0avgdata 368884maxresident)k 0inputs+272288outputs (0major+156736minor)pagefaults 0swaps
After: cached metadata & cached repo
1.07user 0.07system 0:02.05elapsed 56%CPU (0avgtext+0avgdata 94164maxresident)k 0inputs+32outputs (0major+26174minor)pagefaults 0swaps

@r4f4 r4f4 requested a review from ignatenkobrain May 24, 2019 21:22
fus.h Outdated Show resolved Hide resolved
Repo *r;
FOR_REPOS(id, r)
if (r->appdata)
g_free (r->appdata);
Copy link
Member

Choose a reason for hiding this comment

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

hmm, why do we do that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because I save the repomd checksum in repo->appdata (repo.c:751)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added a comment to explain why it's needed.

@r4f4
Copy link
Collaborator Author

r4f4 commented Jul 8, 2019

@ignatenkobrain any further comments on this PR?

r4f4 added 2 commits July 8, 2019 19:17
This way we can focus the solver related functions to fus.c

Signed-off-by: Rafael Fonseca <r4f4rfs@gmail.com>
Signed-off-by: Rafael Fonseca <r4f4rfs@gmail.com>
}

static gchar *
chksum_string_for_filepath (GChecksumType type, const char *filepath)
Copy link
Member

Choose a reason for hiding this comment

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

Can't you just use solv function to transform Chksum into string?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

GLib returns a nice hexadecimal string already. Libsolv returns binary data that I'd have to convert to a readable string.

repo.c Outdated Show resolved Hide resolved
repo.c Outdated Show resolved Hide resolved
repo.c Outdated Show resolved Hide resolved
r4f4 added 2 commits July 9, 2019 12:37
Avoid doing unnecessary allocations and use memcmp directly to compare
the checksums

Signed-off-by: Rafael Fonseca <r4f4rfs@gmail.com>
This can be specially helpful when doing multiple queries on the same
repo metadata.

Solves fedora-modularity#65

Signed-off-by: Rafael Fonseca <r4f4rfs@gmail.com>
@r4f4
Copy link
Collaborator Author

r4f4 commented Aug 14, 2019

@lubomir have you tried this PR out?
@ignatenkobrain what about merging this one?

@ignatenkobrain
Copy link
Member

sure, go ahead

@r4f4
Copy link
Collaborator Author

r4f4 commented Aug 14, 2019

Cool, I'll rebase #72 on this one which will be easier than the other way around.

@r4f4 r4f4 merged commit 9cb602f into fedora-modularity:master Aug 14, 2019
@r4f4 r4f4 mentioned this pull request Aug 14, 2019
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