-
Notifications
You must be signed in to change notification settings - Fork 10
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
Slow execution of phpcbf #2
Comments
So it takes several minutes to update the fixed file. I'm still trying to do console.log and see which part of the extension is taking all this while. Or may be msvsc takes minutes to detect file changes and reload the file? |
So I edited
and
Output: This seems like the time difference in milliseconds was 60147 which is about 60 seconds. So it works. Does it take as long on your side?
|
Please also see: |
I just closed the stdin and now it does it in seconds. Hope this is the correct way. "Time: 135ms; Memory: 8Mb"
|
excellent, thank you :) I'll add, test and push a new version later today (after work). |
@shivanandwp I believe I should close stdin on close, I'm a newb at writing extensions so I might be wrong: exec.on("close", code => {
exec.stdin.end();
}); |
Forget my last comment, closing stdin just after the promise, as you suggested, makes the execution much faster. |
I'm totally newbie but I can mess around. I think it still waits for stdin before it hits close. I tried your code but it still hit a minute. I don't know if the extension is even using stdin. I then placed the end directly after the exec declaration. This does it in
|
I've been reading up on child processes https://nodejs.org/api/child_process.html. Tried to use execFile, but it failed. I'll move |
Fixed in 0.0.3 |
which phpcs
/usr/local/bin/phpcs
which phpcbf
/usr/local/bin/phpcbf
phpcbf -i
The installed coding standards are PEAR, Zend, PSR2, MySource, Squiz, PSR1, WordPress-VIP, WordPress, WordPress-Extra, WordPress-Docs and WordPress-Core
Settings:
"phpcbf.standard": "WordPress",
The text was updated successfully, but these errors were encountered: