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

Load IRB lazily #824

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

Conversation

pocke
Copy link

@pocke pocke commented Aug 1, 2021

This PR makes loading IRB lazy. It improves startup time.

Problem

Byebug always loads IRB, but IRB is necessary only for irb command. It makes startup time slower unnecessarily for non-IRB users.

Solution

Let's load IRB lazily.

Benchmark

About 55ms (50%) faster.

before

$ RUBYLIB=lib ruby -rbenchmark -e 'p Benchmark.realtime{require "byebug/core"};'
0.11415267689153552

after

$ RUBYLIB=lib ruby -rbenchmark -e 'p Benchmark.realtime{require "byebug/core"};'
0.059115791926160455

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.

None yet

1 participant