Using Riffle, every single scroll event in that list view results in a SQLite database write, which reactively updates the visible window of tracks w/ a LIMIT/OFFSET. Putting the DB in the loop at ~60fps!
Yep... how long is this data required to persist? Is there no storage option between "gone if you close window" and "etched with ACID for all time"?
Apple got dinged a while back for wearing their M1 Mac SSDs with excessive swapouts; doubt anyone wants that surprise again.
the SSD wear thing is interesting, hadn't considered that!
there's a big design space here, have done persist-by-default so far because it's simplest. "don't persist at all" is also easy and makes sense sometimes.
i guess maybe could periodically batch writes if really needed
I recommend you work out a way to reduce user pref type writes to no more than a couple a minute. Unlike spinny disks, SSDs have to write at least a page every single time a bit changes. If you have multiple per second you may be aging your disk, and the payoff is small.
Let's say that an SSD page is 4 KB, so writing one of those at 60 Hz is 240 KB/s of writes (without batching). Activity Monitor says that my (mostly idle) Mac is doing between 5 and 60 MB/s of writes, so this is increasing my write traffic by somewhere between 0.4% and 5%.