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

Prefer readlink to greadlink #1484

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Feb 20, 2023

  1. Prefer readlink to greadlink

    rbenv tries to find `greadlink` and then `readlink`. However, there is
    usually no `greadlink` in Linux. Looking for `greadlink` could be a
    significant overhead on some environments where `PATH` contains many
    directories.
    
    Ubuntu on WSL2 is just such an environment. Looking for `readlink`
    before `greadlink` speeds up ruby startup.
    
    Before this change:
    
    ```
    $ time ruby -v
    ruby 3.3.0dev (2023-02-20T01:33:06Z master 7d5794bad5) [x86_64-linux]
    
    real    0m0.532s
    user    0m0.022s
    sys     0m0.087s
    ```
    
    After this change:
    
    ```
    $ time ruby -v
    ruby 3.3.0dev (2023-02-20T01:33:06Z master 7d5794bad5) [x86_64-linux]
    
    real    0m0.419s
    user    0m0.042s
    sys     0m0.055s
    ```
    mame committed Feb 20, 2023
    Configuration menu
    Copy the full SHA
    7cacf8a View commit details
    Browse the repository at this point in the history