Skip to content

perf: Remove regex dependency to fix per-value recompilation - #18

Merged
andrewnester merged 1 commit into
andrewnester:masterfrom
fxwiegand:remove-regex-dependency
Aug 31, 2026
Merged

perf: Remove regex dependency to fix per-value recompilation#18
andrewnester merged 1 commit into
andrewnester:masterfrom
fxwiegand:remove-regex-dependency

Conversation

@fxwiegand

Copy link
Copy Markdown
Contributor

While profiling our project datavzrd I found that compiling a fresh Regex for every string value causes a lot of overhead. The packer and unpacker both do this in hot loops, so on large inputs the recompilation ends up dominating runtime. Since the patterns only look at a value's first characters, I replaced them with plain string checks and dropped the regex dependency entirely. For us this more than halves the render time on large reports, and shouldn't change the output in any way, right?

@fxwiegand

Copy link
Copy Markdown
Contributor Author

@andrewnester thoughts on this?

@andrewnester
andrewnester merged commit 76a4382 into andrewnester:master Aug 31, 2026
1 check passed
@andrewnester

Copy link
Copy Markdown
Owner

Thank you! Yes, makes total sense

@fxwiegand

Copy link
Copy Markdown
Contributor Author

Thank you! Yes, makes total sense

Awesome! Thanks for the quick merge. Also saw you're already preparing the new release so thanks for being so quick with that as well!

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