Closed binarybana closed 2 years ago
Thanks a lot for taking the time to improve this repository, appreciate it 😄
I just noticed this, this is causing a lot more idle CPU usage, would you know what would be causing that?
I have made a branch where sink and caching has been implemented but the thread pooling has been reversed: https://github.com/kb24x7/rustyvibes/tree/revert-10-jk/optimize
I have merged this branch, please create a new PR if you find any fix, thanks
By using a threadpool, we can reduce thread startup times (minimal impact) and more importantly: cache rodio OutputStream creation which costs about 10-20ms per keypress. And all around reduce allocation.
We also cache file reading in a global hashmap.
Ironically, this caching seems to reduce memory usage in my testing (MacOSX looking at private and total).