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

Express + Pry is Laggy #44

Open
bayleedev opened this issue Oct 11, 2016 · 4 comments
Open

Express + Pry is Laggy #44

bayleedev opened this issue Oct 11, 2016 · 4 comments

Comments

@bayleedev
Copy link
Owner

Original Comment

Using express with pry causes it to be unresponsive and difficult to use.

import pry from 'pryjs'

// Ping
router.get('/ping', (req, res) => {
  eval(pry.it)
  res.json({ status:'UP' });
});
@bayleedev bayleedev added the bug label Oct 11, 2016
@zlwaterfield
Copy link

Hey @blainesch any movement on this issue?

@bayleedev
Copy link
Owner Author

No movement, feel free to take a stab at it. I don't have any leads as of yet.

@zlwaterfield
Copy link

zlwaterfield commented Jan 18, 2017

@blainesch all good, after some digging here is what I have found. There are actually two issues I am seeing:

  1. Laggy in express - I tested this on a small express project and there lag is not present. This leads me to believe it has to do with the large size of my project. Maybe there is somewhere that all files/lines are being looped over causing a latency after each keydown

  2. The incorrect line number is being used so the whereami is incorrect. - The command.coffee file that finds the file and line number using the error stack @stack = new Error().stack and this is return a line number much higher than the actual. This is because I am using babel-watch. But the weird thing is the find_file returns the line number is from the compiled ES6 and file location/ file content from the uncompiled ES6 code.

The laggy behaviour seems to be improved when the line number is correct (tested by hard coding the line number). Any ideas on where to continue from here?

Update: The on data event is not triggering for every keypress so its not a lag its the event is only hitting every couple keypresses. this.options.stdin.on('data', this.keypress); https://github.com/blainesch/pry.js/blob/master/src/pry/sync_prompt.coffee#L60.

@bayleedev
Copy link
Owner Author

Interesting find. I wonder why it's not being triggered sometimes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants