eui48 icon indicating copy to clipboard operation
eui48 copied to clipboard

Remove regex crate and do manual parsing

Open oblique opened this issue 4 years ago • 4 comments

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

Fixes #31

oblique avatar Oct 11 '21 17:10 oblique

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

oblique avatar Oct 11 '21 17:10 oblique

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

chrismooredev avatar Dec 23 '22 18:12 chrismooredev

@chrismooredev It looks like this crate is abandoned

oblique avatar Dec 24 '22 09:12 oblique

@chrismooredev It looks like this crate is abandoned

I moved to using advmac crate

fastfailures avatar Jun 23 '23 16:06 fastfailures