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

Refactor and optimize loaded features #5763

headius opened this issue Jun 10, 2019 · 0 comments


None yet
1 participant
Copy link

commented Jun 10, 2019

For recent work on load/require and autoload, I ported over some logic from CRuby to manage the cache of loaded features. This cache builds up a mapping of all subpaths, considering load paths, canonicalized paths, and so on, in order to make future requires of any similar path detect the already-loaded feature. In CRuby, this cache has been carefully crafted to avoid allocating too many extra strings, sharing the backing store for the path among all entries. We currently do not do this, and I believe this may be slowing down load logic instead of speeding it up as the cache should do.

Before releasing JRuby 9.2.8, we will need to revisit this logic and ensure we're only doing the minimum allocation and work necessary to maintain and use the loaded features cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.