Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 395A6CE6A for ; Thu, 25 Jul 2013 17:12:37 +0000 (UTC) Received: (qmail 13052 invoked by uid 500); 25 Jul 2013 17:12:37 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 12917 invoked by uid 500); 25 Jul 2013 17:12:36 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 12354 invoked by uid 99); 25 Jul 2013 17:12:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Jul 2013 17:12:35 +0000 X-ASF-Spam-Status: No, hits=2.5 required=5.0 tests=FRT_ADOBE2,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of agrieve@google.com designates 209.85.160.46 as permitted sender) Received: from [209.85.160.46] (HELO mail-pb0-f46.google.com) (209.85.160.46) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Jul 2013 17:12:29 +0000 Received: by mail-pb0-f46.google.com with SMTP id rq8so1004647pbb.19 for ; Thu, 25 Jul 2013 10:12:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=+jO7+ptS1W2OTq/S4CYqj3q0LDOOe9hnxOaY0ISRfIU=; b=fnl5W9ErcZudHUGn6z588fLbw0e48U0utu7h5xfsh1VKhI0m8g87CItbac6u4yd6gI zk1iJx47Xdfa4i9u3XwNveaCh5dzJ5mVMo4P7V3zCH281EBfepWrvhjn3hMrGqBXST4M dOhLdktrwYY4o6Vcg0Lz0sdkw9px4+CkxRA+tWmdBCEMAu4SsfW+Ydez935MiRKlEk6S eNldMz2n7IUTTAlk5/b2LS5OPhdugiP4JrE8TRASlbcR/vLnZ0WJ/5eXW8Q8wICo3Jik sFn0oN2kzU6aLpGc1MCWOdn+js8C4KmnhMia0ST2M+ZtoAn/FpdFsq9ZMtVymJaJdL7r Ksrw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=+jO7+ptS1W2OTq/S4CYqj3q0LDOOe9hnxOaY0ISRfIU=; b=QkAJruD00VpcS/Tn/2SgU2qsCsPPJrDPVricGelm1RwYKv3ydNSNRRizijBXrxB3BT qQ0xZvzhF8CU1nAdMnitzmbplmLfNTEiSgUAI8vrqhcHaP7Af4YpZZDFXUvpPlZhb8cR BKN8Cpcd/Jxg67rhNdeVvONL+HhLngw0jSs00= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type :x-gm-message-state; bh=+jO7+ptS1W2OTq/S4CYqj3q0LDOOe9hnxOaY0ISRfIU=; b=op0P0p5ico940rzgPsuA4TyJJzPR951UNbgsyvpq0RKL2GYcsIXo8pkBPqlOX+u0on 1AjZQKtwvkJ5M6K8N3jDvIiFWgpvtMUoBsYJXfqDC7lQH56U0iR2imn20S8Y4n7ncKfc 7Z15Y2AM5G/CnNcuBcfqwcDzPyjwRZDD948pSOMcz2PgMUkSvySsQFtBq9NgBlYkxGg4 Np7Qaqe2B5A5G61SshmsuinBTjrF1LJdVKWTyhyfjUjIpLFLjxn9MM30eVFgLxk6xklK +Ng25khQ6AxryYRAfWKq7G9cKza6GFH3yWXSiVRFIaim7a6QTch7bu/rnY+9ZsQeUrwT DlEg== X-Received: by 10.68.115.131 with SMTP id jo3mr49356220pbb.133.1374772328545; Thu, 25 Jul 2013 10:12:08 -0700 (PDT) MIME-Version: 1.0 Sender: agrieve@google.com Received: by 10.68.28.33 with HTTP; Thu, 25 Jul 2013 10:11:47 -0700 (PDT) In-Reply-To: References: From: Andrew Grieve Date: Thu, 25 Jul 2013 13:11:47 -0400 X-Google-Sender-Auth: EuwjI8d0qsxVHi4WGwoFwoyjxeM Message-ID: Subject: Re: Why CLI & Plugman are so slow To: dev Content-Type: multipart/alternative; boundary=047d7b111c994a508104e2592093 X-Gm-Message-State: ALoCoQlMn+dHMQEJpO++1HrPSnMTqajy7wsmIKX3hFSFhKtdpgJoXbd22ZQcmrH6CFsEHZprxJGIjrzpqvN6/QCzh1Ymfd2+hRIjMYMcOE0i8iFQf47+owem1S6d+iOJvoQ+ltRd93w/+mguO4P0MOi6hsmiUc7OYPW6tdpkBp56mBbCsIdlW+d9wrX97dPhRRkPGhzQ0jh5 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b111c994a508104e2592093 Content-Type: text/plain; charset=ISO-8859-1 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 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" 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(); > > --047d7b111c994a508104e2592093--