Skip to content

Remove regex crate and do manual parsing#32

Open
oblique wants to merge 1 commit intoabaumhauer:masterfrom
oblique:remove-regex
Open

Remove regex crate and do manual parsing#32
oblique wants to merge 1 commit intoabaumhauer:masterfrom
oblique:remove-regex

Conversation

@oblique
Copy link
Copy Markdown

@oblique oblique commented Oct 11, 2021

This reduces the binary size from 1.4mb to 264kb.

Fixes #31

@oblique
Copy link
Copy Markdown
Author

oblique commented Oct 11, 2021

Parsing also includes some of the flexibility that regex crate introduced.

This reduces the binary size from 1.4mb to 264kb.

Fixes abaumhauer#31
@chrismooredev
Copy link
Copy Markdown

I'd like to add that this patch improves the runtime of one of my benchmarks by 10x

My use case is parsing MAC addresses through a SQLite3 custom extension. The regex-based version, latest on crates.io, takes ~11s to process 92428 MAC address records (runtime provided is combined of 4 runs through a dirty benchmark script in python), while this patch takes ~1s.

Running perf shows that regex dwarfs the runtime of pretty much every other function. I've attached some screenshots from perf report, of runs of the latest crate vs a monkeypatch of this PR.

pre-patch

post-patch

@oblique
Copy link
Copy Markdown
Author

oblique commented Dec 24, 2022

@chrismooredev It looks like this crate is abandoned

@fastfailures
Copy link
Copy Markdown

@chrismooredev It looks like this crate is abandoned

I moved to using advmac crate

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.

Big binary size

3 participants