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

Poor performance and crashes marshalling large ArrayBuffers from JS to Native side on iOS

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • cordova-ios@4.4.0, cordova-ios@4.3.0, cordova-ios 4.5.0
    • None
    • cordova-ios
    • None
    • iOS 10.3 Simulator
      Using cordova-plugin-wkwebview-engine

    Description

      I'm doing performance analysis on an application that's attempting to write an approx. 10 MB Blob to disk using the File plugin. The uint8ToBase64 function called by iOSExec looks like a particular bottleneck. I'm seeing large memory increases followed by GCs taking approx 1.5 secs. The attached screenshot has a typical Safari timeline.

      After some initial testing, it looks like re-implementing uint8ToBase64 using String.fromCharCode and window.btoa, rather than string appending, might yield some improvements. Some alternate implementations at https://github.com/github-tools/github/issues/137 and https://stackoverflow.com/questions/9267899/arraybuffer-to-base64-encoded-string.

      Is this something you would consider taking a look at? We're also weighing strategies to reduce our file size and the frequency of our writes, but a platform-level fix would be a huge help.

      Attachments

        1. iOS Exec timeline.png
          403 kB
          Tim Hambourger

        Activity

          People

            Unassigned Unassigned
            thambour Tim Hambourger
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: