Skip to content

Refactor and optimize loaded features #5763

@headius

Description

@headius

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions