Return-Path: X-Original-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CE80BDDE4 for ; Thu, 4 Oct 2012 20:11:47 +0000 (UTC) Received: (qmail 19722 invoked by uid 500); 4 Oct 2012 20:11:47 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 19641 invoked by uid 500); 4 Oct 2012 20:11:47 -0000 Mailing-List: contact callback-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-dev@incubator.apache.org Received: (qmail 19631 invoked by uid 99); 4 Oct 2012 20:11:47 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Oct 2012 20:11:47 +0000 Date: Fri, 5 Oct 2012 07:11:47 +1100 (NCT) From: "Andrew Grieve (JIRA)" To: callback-dev@incubator.apache.org Message-ID: <523877966.1603.1349381507561.JavaMail.jiratomcat@arcas> In-Reply-To: <835046334.160617.1349294767982.JavaMail.jiratomcat@arcas> Subject: [jira] [Resolved] (CB-1579) Optimize exec() calls made from plugin callbacks on iOS MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-1579?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andrew Grieve resolved CB-1579. ------------------------------- Resolution: Fixed The biggest win was just removing setTimeout(0) when dispatching plugin results. Results in a 3x gain in IFRAME_NAV and a 6x gain in XHR_NO_PAYLOAD *when* exec() is called from a plugin result callback. In the normal case (when exec() is called not from the context of a plugin result), the speedup is 66% for IFRAME_NAV and 33% for XHR_NO_PAYLOAD. Here are the benchmarks on my iPad 2: Base: Commit: https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-ios.git;a=commit;h=1a4156931a3697c1b47fbfe806f5ba69b1655aa1 IFRAME_NAV: 300 XHR_NO_PAYLOAD: 150 XHR_WITH_PAYLOAD: 190 IFRAME_NAV+async: 143 XHR_NO_PAYLOAD+async: 120 XHR_WITH_PAYLOAD+async: 110 Delete setTimeout in callback result: Commit: https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-ios.git;a=commit;h=c8ac3c2607e9b0dd7d00898e1276337eeaa10044 IFRAME_NAV: 800-900 XHR_NO_PAYLOAD: 830-880 XHR_WITH_PAYLOAD: 350 (not sure why this one was slow) IFRAME_NAV+async: 200-300 XHR_NO_PAYLOAD+async: 150 XHR_WITH_PAYLOAD+async: 200 Check for new exec() in callback. Commit: https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-ios.git;a=commit;h=ba7d771306a51c180da7a5541c4738f08a8cac4d IFRAME_NAV: 950-1000 XHR_NO_PAYLOAD: 980-1000 XHR_WITH_PAYLOAD: 980-1000 IFRAME_NAV+async: 250-260 XHR_NO_PAYLOAD+async: 150-175 XHR_WITH_PAYLOAD+async: 200 Delete cordova.commandQueueFlushing (no change in performance) commit: https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-ios.git;a=commit;h=de046f7ae64421d69fd52befd2b5fd3c351ac28a Add runloop delay to fix alert()s (no change in performance) (commit a part of previous one) Other relevant commits: JS change: https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-js.git;a=commit;h=99fed6dce70a6c6c6a666a72e6a812e595855f18 Updating core plugins to use new plugin results methods: https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-ios.git;a=commit;h=035e2fb9bc76052a54f12b71648daba980af08fa > Optimize exec() calls made from plugin callbacks on iOS > ------------------------------------------------------- > > Key: CB-1579 > URL: https://issues.apache.org/jira/browse/CB-1579 > Project: Apache Cordova > Issue Type: Improvement > Components: iOS > Reporter: Andrew Grieve > Assignee: Andrew Grieve > Fix For: 2.2.0 > > > Using stringByEvaluatingJavascriptString is super fast, and using and XHR / iframe navigation is really slow. The idea here that whenever the native side does a stringByEvaluatingJavascriptString call, to use its return value to bundle the actual return value along with any pending js->native messages -- 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: http://www.atlassian.com/software/jira