Skip to content

Load/require logic lacks path caching and indexing found in MRI #2794

@headius

Description

@headius

MRI has a number of caches and indexes that improve the performance of load/require searching. We lack most of those caches, or have poor implementations of them.

The two key bits I know of:

  • The entries in the load path are made into absolute paths and held in a separate index used for file resolution.
  • The resolved requires are absolutized for LOADED_FEATURES and a mapping is maintained between the require name and the absolute name. This index is updated whenever LOADED_FEATURES is seen to have changed.

We need to implement our loading logic so that it performs similar mappings, both to improve lookup performance and to better match MRI behavior with regards to full paths.

This may push to post-9k since it does not fix any known compatibility issues.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions