Skip to content

Optimize requires for non-omnibus installs#72

Merged
tas50 merged 1 commit into
masterfrom
requires
Aug 17, 2020
Merged

Optimize requires for non-omnibus installs#72
tas50 merged 1 commit into
masterfrom
requires

Conversation

@tas50

@tas50 tas50 commented Aug 12, 2020

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown

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.

3 participants