grammyjs / grammY

The Telegram Bot Framework.
https://grammy.dev
MIT License
2.24k stars 112 forks source link

perf: fast array copy for installed transformers #596

Closed KnorpelSenf closed 4 months ago

KnorpelSenf commented 4 months ago

V8 is fairly optimized for [...arr] and my benchmarks only show a few nanoseconds of improvement for Deno, regardless of the size of the array. However, in general, creating an iterator over an array, traversing all elements on it, and pushing them onto a new array will be slower than a slice call. Since grammY runs in more environments, we can expect greater improvements elsewhere.

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 47.74%. Comparing base (a104c42) to head (e87ba8b). Report is 3 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #596 +/- ## ========================================== - Coverage 47.86% 47.74% -0.13% ========================================== Files 19 19 Lines 6159 6177 +18 Branches 343 343 ========================================== + Hits 2948 2949 +1 - Misses 3207 3224 +17 Partials 4 4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.