cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <>
Subject [jira] [Commented] (CB-7060) WP8. Fix large project build performance issue
Date Wed, 02 Jul 2014 09:29:24 GMT


ASF subversion and git services commented on CB-7060:

Commit 1215a84fd80c1a17f0fe6376c3894397fefe46a7 in cordova-windows's branch refs/heads/master
from sgrebnov
[;h=1215a84 ]

fixes potential perf issue inside exec_verbose method

see CB-7060 WP8. Fix large project build performance issue

> WP8. Fix large project build performance issue
> ----------------------------------------------
>                 Key: CB-7060
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: WP8
>            Reporter: Sergey Grebnov
>            Assignee: Sergey Grebnov
> When a Windows Phone project with many resources is built in VS with Cordova, the project
takes much longer to build than a project for Win 8 or Android. We have identified the function
that is causing the issue; it is the exec_verbose(command) function in <project-folder>\bld\Debug\platforms\wp8\cordova\lib\build.js
> // executes a commmand in the shell
> function exec_verbose(command) {
>     //Log("Command: " + command);
>     var oShell=wscript_shell.Exec(command);
>     while (oShell.Status == 0) {
>         //Wait a little bit so we're not super looping
>         WScript.sleep(100);
>         //Print any stdout output from the script
>         if (!oShell.StdOut.AtEndOfStream) {
>             var line = oShell.StdOut.ReadLine();
>             Log(line);
>         }
>     }
> The WScript.sleep() call gets executed every time through the loop, and when building
a Windows Phone 8 project, every single resource that is added gets its own line in the log.
Thus a project with thousands of resources sleeps thousands of times. This function is identical
in the Win8 build.js file, but the resources aren’t added in the same way as they are for
Windows Phone projects. The Android build.js does something entirely different.
> We have identified a couple potential fixes:
> •Change the if statement to a while loop
> •Leave the if statement but change the ReadLine() call to a ReadAll() call

This message was sent by Atlassian JIRA

View raw message