Send last read chapter in Mangas in Category API #507
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.
What
This PR starts sending last read chapter details in the manga object. The provision to send this was already there but was not utilized for some reason(perhaps performance reasons, but that's just speculation)
Why
This will enable us to implement the sort by last read manga feature
Performance report for API
api/v1/category/{categoryId}
JS code used for benchmarking:
Total Number of Rows in Manga table:
909
Total Number of Manga in Library:
93
Total Number of Rows in Chapter table:
18760
Total Number of Chapters for Mangas in Library:
18345
TIMINGS
Optimized Query after Last Read Chapter change
Average Request time over 10 requests ran 3 times:
392.173333333 ms
Non Optimized query after Last Read Chapter change
Average Request time over 10 requests ran 3 times:
430.143333333 ms
Optimized Query without Last Read Chapter change
Average Request time over 10 requests ran 3 times:
286.22 ms
Optimized Query with new column instead of Chapter object
Average Request time over 10 requests ran 3 times:
304.553333333 ms
Baseline(master branch)
Average Request time over 10 requests ran 3 times:
315.47 ms
Server Hardware details: