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

Provide a way to disable fetching a fresh public suffix list on compile #4

Closed
axelson opened this issue Jul 3, 2017 · 3 comments · Fixed by #15
Closed

Provide a way to disable fetching a fresh public suffix list on compile #4

axelson opened this issue Jul 3, 2017 · 3 comments · Fixed by #15

Comments

@axelson
Copy link

axelson commented Jul 3, 2017

Hi, the ability to fetch a public suffix list on compilation does sound useful, but the compile time of Domainatrex is already quite long (over 10s on heroku) and I'd rather not emit any HTTP requests while compiling. So is it possible to create a way disable fetching the public suffix list on compile?

@Zensavona
Copy link
Owner

Zensavona commented Jul 4, 2017

The reason it takes a long time to compile is because it has macros which declare a match function for every TLD in the public suffix list, which is quite long. I know it sucks that it takes this long, but it means that at runtime the matching is highly performant.

I decided to fetch the public suffix list on compile because the list is updated frequently, and it seems silly to need a new version number and interaction from me every time this happens, and also because typically this library won't be built particularly frequently.

Also, just for what it's worth, I did a quick test (on a 7 year old Macbook Air and very average Australian ADSL, so YMMV). Removing the logic which fetches the new list and just using the one from disk shaves about 2 seconds off the build time (14s becomes 12s). I just used time mix compile to get these numbers.

For me this is not really an issue, but if you have a use case which is more compile-speed-dependent than mine and would like to implement a way to compile with an option to not fetch a new public suffix list, I would be more than happy to have a look at it. I would like the current behaviour to be the default though.

Let me know what you think.

@axelson
Copy link
Author

axelson commented Jul 6, 2017

@Zensavona I understand your point, but one of my goals is having reproducible (or at least near-reproducible) builds and emitting HTTP requests during a build will definitely cause issues with that. I can also imagine scenarios where you are completely unable to make http requests or would prefer not to for security reasons (such as an attacker taking control of the suffix link website/dns).

@Zensavona
Copy link
Owner

I think in the next release I'll make using a local (perhaps old) suffix list optional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants