-
Notifications
You must be signed in to change notification settings - Fork 12
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
expose map item iterator, to load all items in one pass #65
base: master
Are you sure you want to change the base?
Conversation
Hi there! Thanks for the PR. However, I'm inclined to not merge this PR.
So, how to continue? Well for speedup there is the cache. Are you using it? My guess would be that if you used a warmed up KeyPointerCache, you'd get similar speedups. After boot it would still be cold of course. |
ahhh this is what I mentioned in #33 (comment) somehow providing a method to get/iterate all saved items is valuable. I hope we can achieve this one day:D |
ok, this is not needed, thought nice to be able to examine the data easily.
It's very helpful to group them together. especially in case of multiple storage, for example separate frequently changed keyboard macro from a large number of rarely changed key bindings. This makes sure we don't accidentally call wrong args. I can change this if this is your only objection.
It's kind of like history replay, It gets earlier value, and then overwrite with newer value. perfect for initialization usage.
No. It uses the queue method to find first page. This code is common to both queue, and map. Maybe move to lib.rs?
yes, during boot it need to load every item in storage. I tried the KeyPointerCache, it didn't improve the speed for that situation.
The problem with pre warm cache is app have to try every possible key combination to load all, and cache have to be large. We are talking about embedded cpu here. The iterator is more efficient, and people are familiar with this in other map implementations too. |
How many keys and pages are we actually talking about? |
My current config used about 3 pages. Will increase, as I trying more things. The potential keys could be several thousands, most are unused. This project RMK use this Vial web gui to change the multi layer keyboard codes one key at a time. Write many small items separately, will help minimize the wear of flash. and we found your project perfect for this situation, after exposed iterator. |
@diondokter Would removing the host tools and the new storage struct (points 1 and 2) and factoring out the common function from point 4 be sufficient to get this merged? I'd like to see this implemented if possible, since we think the slow startup issue we're seeing in RMK should be fixable by using this iterator. |
Hi, ok, so my major painpoint here is that some things that are considered internal are now going to be exposed. I can see this merged if:
|
RMK use this module to store each key when user customize from vial web tool.
fetching hundreds of items take 8s on esp32c6.
after changed to this iterator, only take 0.1s on same MCU.