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

Make sure to stop byebug if eval raised #369

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

Conversation

MaxLap
Copy link

@MaxLap MaxLap commented Nov 18, 2021

When I put a pry in a loop, it's frequent that when i'm done, I just use !!! to raise an exception which ends my current rails query.
Since I start using pry-byebug, I noticed that doing so made the whole interpreter like 8x slower.

Investigation made me learn that if an exception is raised using commands, this bypasses the usual mechanism that stops byebug, leading to a slow interpretter.
This fixes that behavior by detecting that an exception is propagating out of eval and stopping byebug.

I would assume that situation also happened when someone used the raise-up command.

I don't know enough about Pry, but I would guess this exact fix may be wrong when dealing with nested pry. So there may be some extra-checks needed to make sure we are not nested, but I don't know how to do that.

If an exception is raised using commands, this usually bypasses the usual mechanism that stops byebug, leading to a slow interpretter.
This fixes that behavior by detecting that an exception is propagating out of eval and stopping byebug
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.

2 participants