[jira] [Commented] (CB-13559) Poor performance and crashes marshalling large ArrayBuffers from JS to Native side on iOS

2017-11-10 Thread Tim Hambourger (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-13559?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16247922#comment-16247922
 ] 

Tim Hambourger commented on CB-13559:
-

I also tested on an iPad Mini 2 running iOS 9.3.4. That's where I observed the 
crashes (specifically, the WKWebView would reload unexpectedly). My testing on 
device and in simulator has all been consistent w/ uint8ToBase64 being a 
bottleneck.

> Poor performance and crashes marshalling large ArrayBuffers from JS to Native 
> side on iOS
> -
>
> Key: CB-13559
> URL: https://issues.apache.org/jira/browse/CB-13559
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: cordova-ios
>Affects Versions: cordova-ios@4.4.0, cordova-ios@4.3.0, cordova-ios 4.5.0
> Environment: iOS 10.3 Simulator
> Using cordova-plugin-wkwebview-engine
>Reporter: Tim Hambourger
>Assignee: Suraj Pindoria
>Priority: Critical
> Attachments: iOS Exec timeline.png
>
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-13559) Poor performance and crashes marshalling large ArrayBuffers from JS to Native side on iOS

2017-11-09 Thread Tim Hambourger (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-13559?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16246686#comment-16246686
 ] 

Tim Hambourger commented on CB-13559:
-

FYI, the alternate implementation I've tested so far:

var CHUNK_SIZE = 0x;

function uint8ToBase64 (rawData) {
var strArray = [];
for (var i = 0; i * CHUNK_SIZE < rawData.length; i++) {
strArray.push(String.fromCharCode.apply(null, rawData.subarray(i * 
CHUNK_SIZE, (i + 1) * CHUNK_SIZE)));
}
return window.btoa(strArray.join(''));
}

> Poor performance and crashes marshalling large ArrayBuffers from JS to Native 
> side on iOS
> -
>
> Key: CB-13559
> URL: https://issues.apache.org/jira/browse/CB-13559
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: cordova-ios
>Affects Versions: cordova-ios@4.4.0, cordova-ios@4.3.0, cordova-ios 4.5.0
> Environment: iOS 10.3 Simulator
> Using cordova-plugin-wkwebview-engine
>Reporter: Tim Hambourger
>Assignee: Suraj Pindoria
>Priority: Critical
> Attachments: iOS Exec timeline.png
>
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Created] (CB-13559) Poor performance and crashes marshalling large ArrayBuffers from JS to Native side on iOS

2017-11-09 Thread Tim Hambourger (JIRA)
Tim Hambourger created CB-13559:
---

 Summary: Poor performance and crashes marshalling large 
ArrayBuffers from JS to Native side on iOS
 Key: CB-13559
 URL: https://issues.apache.org/jira/browse/CB-13559
 Project: Apache Cordova
  Issue Type: Bug
  Components: cordova-ios
Affects Versions: cordova-ios 4.5.0, cordova-ios@4.3.0, cordova-ios@4.4.0
 Environment: iOS 10.3 Simulator
Using cordova-plugin-wkwebview-engine
Reporter: Tim Hambourger
Assignee: Suraj Pindoria
Priority: Critical
 Attachments: iOS Exec timeline.png

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.




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-13559) Poor performance and crashes marshalling large ArrayBuffers from JS to Native side on iOS

2017-11-09 Thread Tim Hambourger (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-13559?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tim Hambourger updated CB-13559:

Attachment: iOS Exec timeline.png

> Poor performance and crashes marshalling large ArrayBuffers from JS to Native 
> side on iOS
> -
>
> Key: CB-13559
> URL: https://issues.apache.org/jira/browse/CB-13559
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: cordova-ios
>Affects Versions: cordova-ios@4.4.0, cordova-ios@4.3.0, cordova-ios 4.5.0
> Environment: iOS 10.3 Simulator
> Using cordova-plugin-wkwebview-engine
>Reporter: Tim Hambourger
>Assignee: Suraj Pindoria
>Priority: Critical
> Attachments: iOS Exec timeline.png
>
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org