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

Speed up VerifyIndex #206

Merged
merged 3 commits into from
Dec 25, 2021
Merged

Conversation

RyuzakiKK
Copy link
Contributor

  • Add some tests for VerifyIndex

  • Reduce code duplication while verifying an index
    We can reuse the validate() function of FileSeedSegment and avoid
    duplicating the code here.

  • Feed multiple chunks to the workers while verifying an index
    If we send a single chunk to every Goroutine, the workers will complete
    their task immediately and then will wait for a new chunk to validate.

    If instead we group together multiple chunks we can improve the overall
    performance.

    For example, in my test machine, the required time to verify an index
    that pointed to a 5gb image took 30 seconds, and with this patch it
    dropped to 24 seconds.

Signed-off-by: Ludovico de Nittis <[email protected]>
We can reuse the validate() function of FileSeedSegment and avoid
duplicating the code here.

Signed-off-by: Ludovico de Nittis <[email protected]>
If we send a single chunk to every Goroutine, the workers will complete
their task immediately and then will wait for a new chunk to validate.

If instead we group together multiple chunks we can improve the overall
performance.

For example, in my test machine, the required time to verify an index
that pointed to a 5gb image took 30 seconds, and with this patch it
dropped to 24 seconds.

Signed-off-by: Ludovico de Nittis <[email protected]>
Copy link
Owner

@folbricht folbricht left a comment

Choose a reason for hiding this comment

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

Great re-use of the seed validation logic.

@folbricht folbricht merged commit b7a13be into folbricht:master Dec 25, 2021
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