1
0
mirror of https://github.com/svg/svgo.git synced 2026-01-27 07:02:06 +03:00
Files
svgo/plugins/convertPathData.js
Marvin Hagemeister c641da2734 Speed up strongRound by avoiding string casting (#1716)
I'm currently profiling my build pipeline and noticed that the
`strongRound` function showed up a couple of times, followed immediately
with a bit of GC cleanup shortly after. We can speed up that function by
avoiding the string casting caused by `Number.prototype.toFixed()`.

In my project's build pipeline with lots of svg icons this saves about
1.4s in total.

<img width="792" alt="js-tools-strongRound"
src="https://user-images.githubusercontent.com/1062408/204393563-666be3e0-e0ee-4608-9b7d-9ea8352bd36b.png">
2022-11-30 11:53:39 +03:00

31 KiB