We were doing some perf and memory testing / tuning of our application and noticed a lot of small allocations and overhead of compiling the regex for xs_duration (we have a lot of streams currently processing MPD updates every ~2s; we're not using fetch, but potentially the template url resolution there could benefit from this too though that's a much simpler regex). Moving it to a static improved things a good deal. This does introduce a dependency on lazy_static crate but there was already a transient dependency on it. Let me know what you think.
Excellent, thanks! I'll look at this also for the fetch module, though that already has significant memory allocation requirements for downloading segments.
We were doing some perf and memory testing / tuning of our application and noticed a lot of small allocations and overhead of compiling the regex for xs_duration (we have a lot of streams currently processing MPD updates every ~2s; we're not using fetch, but potentially the template url resolution there could benefit from this too though that's a much simpler regex). Moving it to a static improved things a good deal. This does introduce a dependency on lazy_static crate but there was already a transient dependency on it. Let me know what you think.