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

Implemented Caching in loaded datasets for Improved Performance #379

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

J-B-Mugundh
Copy link
Contributor

@J-B-Mugundh J-B-Mugundh commented Oct 5, 2024

Description:

This PR introduces caching mechanisms for loaded datasets and summary-based functions to enhance application performance and reduce load times. By leveraging Streamlit's built-in st.cache_data function, we aim to optimize repeated access to static CSV data and eliminate unnecessary reloading.

Changes:

  • Implemented a new caching function: cache_data using Streamlit’s st.cache_data feature.
  • Considered implementing a custom caching solution but opted for Streamlit’s in-built function due to its simplicity and efficiency.

Impact:

  • Performance Boost: By caching static datasets (CSV) and summary functions, load times will be significantly reduced, especially in scenarios where real-time data is not required.
  • Resource Efficiency: Reduces redundant processing by storing results from repetitive dataset loading and computation tasks.

References:

https://docs.streamlit.io/develop/api-reference/caching-and-state/st.cache_data

image

Comparison videos of existing load and new load time after cache_data:

Existing: https://drive.google.com/file/d/1DhsmF-K-hCKsOF3mAHOdkFp8q8aB2rqX/view?usp=sharing

New: https://drive.google.com/file/d/1ZF7YFSDCMZ2Y0K9ZTMGbYY2l0nuY6hi8/view?usp=sharing

Related issue:

#372

Copy link

github-actions bot commented Oct 5, 2024

Thank you for submitting your pull request! 🙌 We'll review it as soon as possible. In the meantime, please ensure that your changes align with our CONTRIBUTING.md. If there are any specific instructions or feedback regarding your PR, we'll provide them here. Thanks again for your contribution! 😊

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome to Our repository.🎊 Thank you so much for taking the time to point this out.

@J-B-Mugundh
Copy link
Contributor Author

@sanjay-kv Could you please review the PR?

@J-B-Mugundh
Copy link
Contributor Author

@sanjay-kv Thanks for adding labels. Please let me know if I had to do any changes!

@sanjay-kv
Copy link
Member

its all good .

@sanjay-kv sanjay-kv merged commit 83cd170 into recodehive:main Oct 7, 2024
2 checks passed
Copy link

github-actions bot commented Oct 7, 2024

🎉 Your pull request has been successfully merged! 🎉 Thank you for your valuable contribution to our project. Your efforts are greatly appreciated. Feel free to reach out if you have any more contributions or if there's anything else we can assist you with. Keep up the fantastic work! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants