-
Notifications
You must be signed in to change notification settings - Fork 10
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
Conversation
Repo *r; | ||
FOR_REPOS(id, r) | ||
if (r->appdata) | ||
g_free (r->appdata); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
@ignatenkobrain any further comments on this PR? |
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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>
@lubomir have you tried this PR out? |
sure, go ahead |
Cool, I'll rebase #72 on this one which will be easier than the other way around. |
Command:
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