Skip to content
New issue

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

[Question] Consider make idna optional? #727

Closed
shuoli84 opened this issue Nov 16, 2021 · 5 comments · Fixed by #728
Closed

[Question] Consider make idna optional? #727

shuoli84 opened this issue Nov 16, 2021 · 5 comments · Fixed by #728

Comments

@shuoli84
Copy link

Background:
I am developing a rust sdk with strong binary size requirement, after introduce url crate, the binary size increased by around 400kb.
I did a quick hack, delete all code reference to idna (4 to 5 places), and compare the final binary size, confirmed idna is the cause.

# before 
-rwxr-xr-x  1 xxxxxx staff  1143856 Nov 16 12:12 ../target/release/deps/parse_url-124867e06fe8f448

# after delete idna code
-rwxr-xr-x  1 xxxxxx  staff  591008 Nov 16 12:16 ../target/release/deps/parse_url-8091d2463bfcb288
@shuoli84 shuoli84 changed the title [Question] Consider add make idna optional? [Question] Consider make idna optional? Nov 16, 2021
@valenting
Copy link
Collaborator

This was brought up in #557

When you say Consider make idna optional I think you mean make it opt-out not opt-in, via a feature flag, right?
I defer to @SimonSapin on whether we'd want to do that.

@shuoli84
Copy link
Author

@valenting yap, opt out, it should included in default features.

@SimonSapin
Copy link
Member

Yes, IDNA depends on some large-ish tables of Unicode data so I’m not surprised about this effect on code size.

A default Cargo feature seems reasonable. (However I don’t expect to dedicate time to rust-url soon, much more than the occasional comment like this.)

@valenting
Copy link
Collaborator

I'm happy to review a PR that adds the Cargo feature.

@shuoli84
Copy link
Author

np, I'm more than happy to make a pr.

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 a pull request may close this issue.

3 participants