diff --git a/RELEASE-v0.9.md b/RELEASE-v0.9.md index 44eaf11a4..c80a84b23 100644 --- a/RELEASE-v0.9.md +++ b/RELEASE-v0.9.md @@ -392,6 +392,7 @@ perform the Xous firmware upgrade. This requires running manual update commands, - #388 via @eupn adds physical address resolution for a remote virtual memory process, allowing for coordination with remote DMA initiators. Does introduce some potential security problems, so gated behind the `v2p` flag. - Fix #339 by adjusting the shellchat API call to match what is done in status bar - Improved wifi scanning (fixes #336) - scans are now sorted by strength; old APs are retired; and the UX will pause while the scan occurs. Repeated scans still require going through the entire menu tree again; this is because modal radio-box lists aren't dynamically updateable. +- Improve performance of filtering operations in `vault` by ~100x by refactoring the item cache to work on `Vec` that is repeatedly sorted, instead of on a `BTreeMap` that is referenced. Turns out that sorting is a far cheaper operation than reference-counted shared references, or copying data to the heap (to avoid the shared reference). ## Roadmap - Lots of testing and bug fixes diff --git a/apps/vault/src/itemcache.rs b/apps/vault/src/itemcache.rs index 6b53639b3..aac0f13b2 100644 --- a/apps/vault/src/itemcache.rs +++ b/apps/vault/src/itemcache.rs @@ -171,6 +171,10 @@ impl ListItem { } pub struct FilteredListView { + // You might be thinking "why use a vec when a BTreeMap can guarantee uniqueness and sorting?" + // See PR #389 for an explanation of why that's a terrible idea. The TL;DR is that sorting is cheap + // compared to copying data. Or more precisely, sorting is cheap compared to figuring out where + // on the heap to copy data. list: Vec, sorted: bool, selection_index: usize,