Skip to content

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