thednp / svg-path-commander

Typescript tools for advanced processing of SVG path data.
https://thednp.github.io/svg-path-commander/
MIT License
222 stars 19 forks source link

Performance issue #44

Open LitoMore opened 1 week ago

LitoMore commented 1 week ago

This library is relatively slow compared to svgpath and svg-path-bbox.

You can use these SVG images below to test the performance:

https://cdn.simpleicons.org/lerna
https://cdn.simpleicons.org/pubg
thednp commented 1 week ago

In what exactly?

LitoMore commented 1 week ago

All of them, like scale, translate, and getPathBBox.

thednp commented 1 week ago

Yea transforms are made by a DOMMatrix shim to allow 3D projections, where svgpath uses a 2D only model, if we were to use that, the performance would be within margin of error.

But as for the pathBBox that totally depends on many things, certainly something to look at in the future. Reminding myself what's what, I implemented a unified segment factory for each path command and that's not the most efficient way to find the pathBBox.

Thanks again for bringing these up.