Commits
Click on a commit to change the comparison rangeRefactor string operations and loops for performance
This commit introduces several changes to improve performance in non-optimizer code paths:
1. **Optimized String Formatting:**
- Refactored the `impl_value_string!` macro in `value_macros.rs` to use `write!` for `Array` and `Dict` stringification, reducing intermediate string allocations.
- Modified `eval_interpolated_string` in `eval.rs` to use `write!` for constructing interpolated strings, avoiding unnecessary allocations.
2. **Optimized `eval_foreach`:**
- Refactored the `eval_foreach` function in `eval.rs` to use `map().collect()` instead of manual `Vec` pushing with `try_fold`, potentially improving conciseness and leveraging iterator optimizations.
Analysis of `RuntimeValue`/`Value` conversions and `Env` lookups did not reveal immediate major bottlenecks, so significant changes in those areas were deferred.
These changes are expected to improve performance, especially in scenarios involving heavy string manipulation or frequent iteration in `foreach` loops. Benchmarks were run successfully, and further detailed performance analysis will be observed via CodSpeed reports.1 day ago
by google-labs-jules[bot]