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

Added Entry::getRedirectEntryIndex() #716

Merged
merged 1 commit into from
Aug 2, 2022

Conversation

veloman-yunkan
Copy link
Collaborator

@veloman-yunkan veloman-yunkan commented Jul 27, 2022

Needed for openzim/zim-tools#312

Entry::getRedirectEntryIndex() is functionally equivalent to Entry::getRedirectEntry().getIndex(). However, the latter involves access to the dirent of the target entry. When only the index of the target entry is of interest, unnecessarily loading the target dirent may turn sequential disk IO (when iterating entries by their native order) to somewhat random disk IO. The new method is devoid of that drawback.

@codecov
Copy link

codecov bot commented Jul 27, 2022

Codecov Report

Merging #716 (52d8fb8) into master (35dd6c8) will increase coverage by 0.16%.
The diff coverage is 100.00%.

❗ Current head 52d8fb8 differs from pull request most recent head db4b3e5. Consider uploading reports for the commit db4b3e5 to get more accurate results

@@            Coverage Diff             @@
##           master     #716      +/-   ##
==========================================
+ Coverage   84.63%   84.80%   +0.16%     
==========================================
  Files          98       98              
  Lines        4314     4316       +2     
  Branches     1867     1867              
==========================================
+ Hits         3651     3660       +9     
+ Misses        662      655       -7     
  Partials        1        1              
Impacted Files Coverage Δ
include/zim/entry.h 100.00% <ø> (ø)
src/entry.cpp 87.87% <100.00%> (+10.45%) ⬆️
include/zim/error.h 100.00% <0.00%> (+33.33%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 35dd6c8...db4b3e5. Read the comment docs.

`Entry::getRedirectEntryIndex()` is functionally equivalent to
`Entry::getRedirectEntry().getIndex()`. However, the latter involves
access to the dirent of the target entry. When only the index of the
target entry is of interest, unnecessarily loading the target dirent may
turn sequential disk IO (when iterating entries by their native order)
to somewhat random disk IO. The new method is devoid of that drawback.
Copy link
Collaborator

@mgautierfr mgautierfr left a comment

Choose a reason for hiding this comment

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

LGTM

@mgautierfr mgautierfr merged commit 92f6832 into master Aug 2, 2022
@mgautierfr mgautierfr deleted the Entry__getRedirectEntryIndex branch August 2, 2022 19:03
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.

3 participants