Skip to content

performance: speed up mergePath child node removal - #2216

Merged
KTibow merged 1 commit into
svg:mainfrom
mozzie:feat/improve_mergePaths_node_removal_performance
Apr 17, 2026
Merged

KTibow merged 1 commit into
svg:mainfrom
mozzie:feat/improve_mergePaths_node_removal_performance

Conversation

@mozzie

@mozzie mozzie commented Apr 17, 2026 •

Copy link
Copy Markdown
Contributor

Improved performance on mergePaths plugin. Changed the to-be-deleted node from a list to Set. I ran into performance issues with large files, and some of them were significantly improved by changing the data structure.

Does not change any behavior: the list was previously used just for .includes, which is an O(n) call. The .has in set is O(1).

@KTibow KTibow changed the title Improve mergePath child node removal performance performance: speed up mergePath child node removal Apr 17, 2026
@KTibow
KTibow merged commit 581fe68 into svg:main Apr 17, 2026
17 checks passed
social4hyq pushed a commit to social4hyq/homebrew-core that referenced this pull request Sep 20, 2026
svgo 4.0.2

Created-by: HarmonybrewBot
Commit-by: HarmonybrewBot
Merged-by: HarmonybrewBot
Description: Created by `brew bump`

---

Created with `brew bump-formula-pr`.<details>
  <summary>release notes</summary>
  <pre>## What's Changed

### Security

* [removeScripts](https://svgo.dev/docs/plugins/removeScripts/), remove JavaScript URIs case-insensitively and make `<script>` handling namespace aware. By @SethFalco

### Bug Fixes

* [convertColors](https://svgo.dev/docs/plugins/convertColors/), skip case-normalization for CSS custom properties. By @SethFalco in svg/svgo#2213
* [convertPathData](https://svgo.dev/docs/plugins/convertPathData/), improve handling of consecutive `t` commands. By @KTibow in svg/svgo#2156
* [convertPathData](https://svgo.dev/docs/plugins/convertPathData/), safer handling of paths. By @KTibow in svg/svgo#2158
* Improve parsing of negative (or +) arc radii. By @KTibow in svg/svgo#2205
* When converting to a data URI, only encode it as a data URI once. By @johnkenny54 in svg/svgo#2053

### Performance

* [mergePaths](https://svgo.dev/docs/plugins/mergePaths/), speed up child node removal. By @mozzie in svg/svgo#2216

### Other Changes

* [removeAttributesBySelector](https://svgo.dev/docs/plugins/removeAttributesBySelector/), log warning and noop if missing parameters. By @KTibow in https://github.com/svg/svgo/pull/2215</pre>
  <p>View the full release notes at <a href="https://github.com/svg/svgo/releases/tag/v4.0.2">https://github.com/svg/svgo/releases/tag/v4.0.2</a>.</p>
</details>
<hr>

See merge request: Harmonybrew/homebrew-core!14100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants