Skip to content

Improved XMLNode::~XMLNode perfomance#1075

Merged
leethomason merged 6 commits into
masterfrom
IMBIGFISH4-master
May 23, 2026
Merged

Improved XMLNode::~XMLNode perfomance#1075
leethomason merged 6 commits into
masterfrom
IMBIGFISH4-master

Conversation

@leethomason
Copy link
Copy Markdown
Owner

#1044 with comments.

IMBIGFISH4 and others added 6 commits July 29, 2025 16:30
XMLNode::~XMLNode uses interface method DeleteChildren(), which
iteratively removes the first child until the list is empty. Each single
removal performs additional checks and keeps _firstChild and _lastChild
links in a consistent state. This leads to a performance penalty.

The proposed patch solves this problem by iterating the list of the
children and directly destroying them without keeping links in a
consistent state.

The performance boost we gained on xmltest is:
- 3% for my laptop (x86_64)
- 9% for bananapi f3 board (riscv64)
@leethomason leethomason merged commit 8d8472f into master May 23, 2026
12 checks passed
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.

2 participants