We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have this code:
fn main() { eui48::MacAddress::parse_str("00:11:22:33:44:55").unwrap(); }
When I compile with eui48's master branch and release profile, I get a binary of 1.4mb:
master
oblique@dystopia /~tmp/eui48-example % cargo build --release Compiling memchr v2.4.1 Compiling regex-syntax v0.6.25 Compiling rustc-serialize v0.3.24 Compiling aho-corasick v0.7.18 Compiling regex v1.5.4 Compiling eui48 v1.1.0 (/home/oblique/git/eui48) Compiling eui48-example v0.1.0 (/tmp/eui48-example) Finished release [optimized] target(s) in 17.78s oblique@dystopia /tmp/eui48-example % strip target/release/eui48-example oblique@dystopia /tmp/eui48-example % du -h target/release/eui48-example 1.4M target/release/eui48-example
I noticed that you do not use any unicode features of regex, so I changed regex dependency of eui48's Cargo.toml to:
regex = { version = "1.3.9", default-features = false, features=["std"], optional = false }
and then I got a binary of 604kb:
oblique@dystopia /tmp/eui48-example % cargo build --release Compiling regex-syntax v0.6.25 Compiling regex v1.5.4 Compiling eui48 v1.1.0 (/home/oblique/git/eui48) Compiling eui48-example v0.1.0 (/tmp/eui48-example) Finished release [optimized] target(s) in 8.42s oblique@dystopia /tmp/eui48-example % strip target/release/eui48-example oblique@dystopia /tmp/eui48-example % du -h target/release/eui48-example 604K target/release/eui48-example
I decided to write the parsing manually and I got a binary of 264kb:
oblique@dystopia /tmp/eui48-example % cargo build --release Compiling eui48 v1.1.0 (/home/oblique/git/eui48) Compiling eui48-example v0.1.0 (/tmp/eui48-example) Finished release [optimized] target(s) in 0.55s oblique@dystopia /tmp/eui48-example % strip target/release/eui48-example oblique@dystopia /tmp/eui48-example % du -h target/release/eui48-example 264K target/release/eui48-example
Also in the latest case, compilation time is under a second.
The text was updated successfully, but these errors were encountered:
Remove regex crate and do manual parsing
467c778
Fixes abaumhauer#31
49b714d
This reduces the binary size from 1.4mb to 264kb. Fixes abaumhauer#31
7ac583d
Successfully merging a pull request may close this issue.
I have this code:
When I compile with eui48's
master
branch and release profile, I get a binary of 1.4mb:I noticed that you do not use any unicode features of regex, so I changed regex dependency of eui48's Cargo.toml to:
and then I got a binary of 604kb:
I decided to write the parsing manually and I got a binary of 264kb:
Also in the latest case, compilation time is under a second.
The text was updated successfully, but these errors were encountered: