Mithronn / rusty_ytdl

A Rust library for Youtube video searcher and downloader
https://docs.rs/rusty_ytdl
MIT License
107 stars 20 forks source link

Greatly improved performance #17

Closed ccgauche closed 8 months ago

ccgauche commented 8 months ago

I took most of the low hanging fruits: ~ +5-15% on caching ~ +5-10% on parsing Plus some general improvements to performance that maybe all had up to 1% but I wasn't able to test it because of the network variability.

On my computer (Ryzen 7950XT):

A new performance analysis mode has been added, enabling the use of flamegraphs.

Note that most of the improvements are on CPU bound tasks. On lower end CPUs the improvement would probably be a lot more since I'm mostly network bound.

I also added comments on my change to explain how much each one improved performance. I noticed also that the code could be simplified by quite a margin, I do a followup PR on code aesthetics and quality.

Mithronn commented 8 months ago

Thanks for your efforts and great pr