-
Couldn't load subscription status.
- Fork 38
Add PSRAM-based NVS caching #219
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
base: develop
Are you sure you want to change the base?
Conversation
|
thx a lot! The idea is good and I (mostly) like the implementation. A couple of things I noticed on first glance:
The config is a difficult topic at a whole I know. Complete mess 😅 I also tried - once at least - to refactor everything into a class with I like the What also would be possible is to cache the "rendered" json response from the HTTP API for a short period of time, it would reduce CPU load and NVS access too and would be maybe a little bit less "invasive". Not sure though |
|
Thanks for the quick feedback 🙌
|
|
I realized the last commit missed a few key points 🙈 Summary:
|
|
Pushed too quickly earlier 🙈 Sorry 🙌 |
6ea02ec to
fcdeed4
Compare
|
🙌 @shufps : Pls. let me know if you’d prefer a new PR instead. Changes:
Sample logoutput: PS: Performance improvement using PSRAM cache about ~400x faster than NVS 🚀🥳 |
|
Hi, is this subject still in the loop of attention? |
fcdeed4 to
3782368
Compare
|
Rebased the branch onto latest The branch should now be ready for the next release @shufps 😉 |
This PR introduces a RAM-based caching layer for configuration values stored in NVS, along with a batched flush mechanism to reduce latency and flash wear.
Summary of changes:
Config::get*()calls now return cached values if available, avoiding repeated flash reads.Config::set*()calls only modify the RAM cache and mark entries as dirty.flush_nvs_changes()function writes only dirty entries to NVS in a single transaction.flush_nvs_changes()after updates.ESP_LOGD).Benefits:
/api/system/info.No configuration values or behavior are affected unless they are written via the API or auto-flush is triggered.