perf: optimize URL string formatting in fetch_historical_rates_batch

Replaced `format!` with `String::with_capacity` and `push_str` for URL construction inside the `fetch_historical_rates_batch` loop.
This avoids parsing overhead and reduces allocations in the hot path.

Co-authored-by: Horizontal42 <75383519+Horizontal42@users.noreply.github.com>
This commit is contained in:
google-labs-jules[bot] 2026-08-26 14:08:11 +00:00
parent 37cfd2144b
commit 37c7de286a

View file

@ -631,7 +631,10 @@ async fn fetch_historical_rates_batch(
let mut futures = Vec::new(); let mut futures = Vec::new();
for date in missing_dates { for date in missing_dates {
let url = format!("https://api.frankfurter.dev/v1/{}?from=USD", date); let mut url = String::with_capacity(42 + date.len());
url.push_str("https://api.frankfurter.dev/v1/");
url.push_str(&date);
url.push_str("?from=USD");
let client_clone = client.clone(); let client_clone = client.clone();
let app_clone = app.clone(); let app_clone = app.clone();