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

Optimize requires for non-omnibus installs #72

Merged
merged 1 commit into from
Aug 17, 2020
Merged

Optimize requires for non-omnibus installs #72

merged 1 commit into from
Aug 17, 2020

Conversation

tas50
Copy link
Contributor

@tas50 tas50 commented Aug 12, 2020

require is quite slow in Ruby and doing requires for things you've already required is also slow. We've used this simple hack in Chef to speed up our requires. In the omnibus installs we patch how rubygems works to make this somewhat pointless, but this will help non-omnibus installs

Signed-off-by: Tim Smith tsmith@chef.io

require is quite slow in Ruby and doing requires for things you've already required is also slow. We've used this simple hack in Chef to speed up our requires. In the omnibus installs we patch how rubygems works to make this somewhat pointless, but this will help non-omnibus installs

Signed-off-by: Tim Smith <tsmith@chef.io>
@tas50 tas50 merged commit 7b2afab into master Aug 17, 2020
@djberg96
Copy link
Collaborator

@tas50 I don't know if it's of any interest to you now, but I think require uses File.expand_path under the hood, which I improved here: https://github.com/djberg96/win32-xpath.

I could be wrong, but I'd be curious to see some require benchmarks with and without win32-xpath.

@lamont-granquist
Copy link

Yeah we've "locally" patched ruby to remove some excessive "expand_pathing" going on. Although its here where it calls rb_realpath_internal: https://github.com/chef/omnibus-software/pull/1129/files

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.

None yet

3 participants