cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filip Maj <...@adobe.com>
Subject Re: Why CLI & Plugman are so slow
Date Thu, 25 Jul 2013 17:28:22 GMT
As a quick fix, as long as it works properly on windows and *nix, I think
that¹s a good thing to change.

Longer-term, I'd actually like to go back to child_process anyways, to be
able to stream output properly from shell'ed out commands during debug
mode. With shelljs, we get the output in one giant text dump. With c_p,
you can get the output streamed to your terminal as it happens, which I
think would be better "DX" (developer experience)

On 7/25/13 10:23 AM, "Anis KADRI" <anis.kadri@gmail.com> wrote:

>https://github.com/rbranson/node-ffi
>
>looks like it does
>
>On Thu, Jul 25, 2013 at 10:14 AM, Filip Maj <fil@adobe.com> wrote:
>> Does it work with Windows?
>>
>> On 7/25/13 10:11 AM, "Andrew Grieve" <agrieve@chromium.org> wrote:
>>
>>>Looks like the fix is pretty easy:
>>>
>>>agrieve@agrieve-macbookpro ~/git/cordova/tmp$ time node go3.js
>>>went 0 times
>>>went 10 times
>>>went 20 times
>>>went 30 times
>>>went 40 times
>>>went 50 times
>>>went 60 times
>>>went 70 times
>>>went 80 times
>>>went 90 times
>>>went 100 times
>>>
>>>real 0m0.444s
>>>user 0m0.266s
>>>sys 0m0.158s
>>>
>>>
>>>All I did was replace "shelljs" with "shelljs-ffi".
>>>
>>>
>>>On Thu, Jul 25, 2013 at 12:53 PM, Filip Maj <fil@adobe.com> wrote:
>>>
>>>> Cool, nice work.
>>>>
>>>> We could either try to contribute to shelljs or rip it out and go all
>>>> child process all the time
>>>>
>>>> In any case I think this bench should be submitted to shelljs repo.
>>>>@r2r,
>>>> dude who maintains it, would probably like to know
>>>>
>>>> On 7/25/13 9:50 AM, "Andrew Grieve" <agrieve@chromium.org> wrote:
>>>>
>>>> >One reason: shelljs.exec()
>>>> >
>>>> >Did a test to see how many times I could execute "true". 9 seconds vs
>>>>.5
>>>> >seconds!
>>>> >
>>>> >
>>>> >agrieve@agrieve-macbookpro ~/git/cordova/tmp$ time node
>>>>shelljstest.js
>>>> >went 0 times
>>>> >went 10 times
>>>> >went 20 times
>>>> >went 30 times
>>>> >went 40 times
>>>> >went 50 times
>>>> >went 60 times
>>>> >went 70 times
>>>> >went 80 times
>>>> >went 90 times
>>>> >went 100 times
>>>> >
>>>> >real 0m8.873s
>>>> >user 0m10.941s
>>>> >sys 0m6.005s
>>>> >agrieve@agrieve-macbookpro ~/git/cordova/tmp$ time node
>>>> >child_processtest.js
>>>> >went 10 times
>>>> >went 20 times
>>>> >went 30 times
>>>> >went 40 times
>>>> >went 50 times
>>>> >went 60 times
>>>> >went 70 times
>>>> >went 80 times
>>>> >went 90 times
>>>> >went 100 times
>>>> >
>>>> >real 0m0.470s
>>>> >user 0m0.278s
>>>> >sys 0m0.228s
>>>> >
>>>> >
>>>> >Here's the code:
>>>> >shelljstest.js
>>>> >
>>>> >var shjs = require('shelljs');
>>>> >> for (var i = 0; ; ++i) {
>>>> >>     shjs.exec('true');
>>>> >>     if ((i / 10 | 0) == i / 10) {
>>>> >>       console.log('went ' + i + ' times');
>>>> >>     }
>>>> >>     if (i == 100) {
>>>> >>       process.exit(0);
>>>> >>     }
>>>> >> }
>>>> >
>>>> >
>>>> >child_processtest.js
>>>> >
>>>> >var child = require('child_process');
>>>> >> var i = 0;
>>>> >> function go() {
>>>> >>   child.exec('true', function() {
>>>> >>     ++i;
>>>> >>     if ((i / 10 | 0) == i / 10) {
>>>> >>       console.log('went ' + i + ' times');
>>>> >>     }
>>>> >>     if (i == 100) {
>>>> >>       process.exit(0);
>>>> >>     }
>>>> >>     go();
>>>> >>   });
>>>> >> }
>>>> >> go();
>>>>
>>>>
>>


Mime
View raw message