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

Cache feed results after full_text filter #112

Merged
merged 3 commits into from
May 9, 2024

Conversation

olehbozhok
Copy link
Contributor

Added cache feed results after full_text filter.
It allows avoid calling try_fetch_full_post twice for the same post. So performance of application is increased from 10s to 1s on my Raspberry Pi. I think it is a huge impact.

Copy link
Owner

@shouya shouya left a comment

Choose a reason for hiding this comment

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

Thank you! I previously tried to tackle the same performance issue with #61 as solution. However, I indeed overlooked the scenario on single-core processors.

src/feed.rs Outdated Show resolved Hide resolved
src/filter/full_text.rs Outdated Show resolved Hide resolved
src/client.rs Show resolved Hide resolved
src/cache.rs Outdated Show resolved Hide resolved
PostPreview is better key for cache,

Renamed ResultCache  to TimedLruCache,

Extracted closure to standalone method.
@shouya shouya self-requested a review May 9, 2024 23:46
@shouya shouya merged commit 8dbc23c into shouya:master May 9, 2024
1 check passed
@olehbozhok olehbozhok deleted the cache-feed-results-after-filter branch May 10, 2024 09:07
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