Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-7060

WP8. Fix large project build performance issue

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      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

      Attachments

        Activity

          People

            sgrebnov Sergey Grebnov
            sgrebnov Sergey Grebnov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: