Fix extreme time trying to load favicon data #1359
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to: #1352
There's a clear regression issue in libkiwix 14.1.
Context
We have this call:
It suppose to return the favicons image data. We are calling it as part of fetching the catalog. In reality, it never returns any data, but that's nothing new, it wasn't returning any data as of libkiwix 14.0.1 either.
(see related past issues: kiwix/libkiwix#1180, I am not sure if that was meant to be fixed)
The problem
The real problem is how long it tries to do return that data (even-though the result is always nil).
I've checked the commit merging libkiwix 14.1, and the one right before, and compared the builds from both by running fresh installs on iPad.
On libkiwix 14.0.1 the average time to fetch the catalog is about 20 sec.
On libkiwix 14.1, I got fed up measuring it when it went over 1 minute 30 sec (and still not finished doing it).
Solution
If we bypass this call, and return directly
nil, the outcome will be the same, but we don't need to wait for it, and we get back to our expected ~20 seconds loading time.