incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Grieve (JIRA)" <>
Subject [jira] [Commented] (CB-638) Slow native bridge (especially android)
Date Thu, 06 Sep 2012 23:31:07 GMT


Andrew Grieve commented on CB-638:

What an excellent time to ask for an update! I've got some fresh measurements to share.

All of the modes are already checked in to the main repo, but I've got several local tweaks
& changes (mostly for online events) that I'm holding off merging until 2.1.0 is out the
door. You can see them here:

Timings from today:

The updated todo list is:
 * Make the native side set the online state to on/off on start-up just in case it one day
doesn't default to ON at start-up.
 * Make poll retrieve all pending messages instead of one-at-a-time.
 * Make poll retrieve a list of callback responses that it can pass to cordova.callbackSuccess/callbackFailure
directly (to save on eval() cost)
 * Use a thread-pool in PluginManager instead of spinning up a new thread every time
 * Redo benchmarks

Updates on my thinking:
 * LOCATION_CHANGE is not faster for the async case (I wasn't thinking straight when I said
this), it is faster only for calls that have no return values.
   * Due to the way exec always requires a callback (either win or fail), this never applies!
   * It could be made to work if we faked the success callback from JS and update all platforms
to not send the OK from native code. This is not worth the effort.
 * Adding fail-safe logic for PRIVATE_API is probably not worth it, as it currently looks
like ONLINE_EVENTS is just as fast (and maybe faster after more optimizing). Let's not use
it if there's no big win.

> Slow native bridge (especially android)
> ---------------------------------------
>                 Key: CB-638
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: Android
>            Reporter: Lee Crossley
>            Assignee: Andrew Grieve
>            Priority: Critical
>              Labels: 2.1.0
> Doing many native callbacks (such as writing files) has a significant overhead.
>'s native bridge is more than 5 times faster than Cordova (on Android).
> I'd love to see similar performance stats in Cordova.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message