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 AC9A4D1EE for ; Fri, 5 Oct 2012 14:50:21 +0000 (UTC) Received: (qmail 44723 invoked by uid 500); 5 Oct 2012 14:50:21 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 44679 invoked by uid 500); 5 Oct 2012 14:50:21 -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 44671 invoked by uid 99); 5 Oct 2012 14:50:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Oct 2012 14:50:21 +0000 X-ASF-Spam-Status: No, hits=2.5 required=5.0 tests=FRT_ADOBE2,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mmocny@google.com designates 209.85.220.47 as permitted sender) Received: from [209.85.220.47] (HELO mail-pa0-f47.google.com) (209.85.220.47) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Oct 2012 14:50:15 +0000 Received: by mail-pa0-f47.google.com with SMTP id fa11so1723140pad.6 for ; Fri, 05 Oct 2012 07:49:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :x-system-of-record; bh=htVfaQt0ZSlK7RMfmksgljJNI3ua42UVYz6zkiB2P/0=; b=j3M+44hu7CM0lExpjGmbJLfcavvpgXG3C5sGVqqc6YtKOwDAxaAvQKCPVk2Z2EIBlO Jm5kKoIYgAD57sGaF7DFObef9ylhd94/9mE7ZaxwO4Pp0yPEvtOEzVb88ku7BjWWoFgM cKYyKyykO6YJg43mbmZeeNHj1gnBAgWEBzn7ZuQiKpkfnaD8hE0hWjn4dS54xaYLB5bs jv/+bVe+FUepSjv1IV14IicZtIbZBy8vBbpzhvtqT0qxyVxpd7fk5rARusrfocPpWlI+ VTYceorGtV6eEPVXysyqJyiKG6hOOW+jSnYjjoM/5qPk/kUUUG46qOprE3tVNn/+Z9RD Q9lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :x-system-of-record:x-gm-message-state; bh=htVfaQt0ZSlK7RMfmksgljJNI3ua42UVYz6zkiB2P/0=; b=ebSyitnlrwCGKiSeHbmY09nDM+vdixlIPuc9LsnUD643Kv8NZp9BV5kgce/LVtpkQl nSmlL3l0huZJWwJc4rw/CIcl4xfpQoSJ7+TLbr78Vg5kqv4imrNKcBKITgOlitIAXnzV vt4ic8ZEUwPqHmX9RlnWcgQ/ELFlQ5IEDrclixZYU1xZkYwQ2Qi/WxiNRWwYDLsa0Ika UKiXqRERamGOLTFBX+tTkLvhuKwD+zJoDvzARi3ryLaL6TTm/6m0yI34xuJ8aeS5Di7n YDEmHbBj1Q7rr3ASg4K2jNEmwD02wMGmae5ShMOv8swB2X5M4undFLUgDfViEQTfExMq Q5WA== MIME-Version: 1.0 Received: by 10.66.79.69 with SMTP id h5mr22343523pax.12.1349448595405; Fri, 05 Oct 2012 07:49:55 -0700 (PDT) Sender: mmocny@google.com Received: by 10.68.32.9 with HTTP; Fri, 5 Oct 2012 07:49:55 -0700 (PDT) In-Reply-To: References: Date: Fri, 5 Oct 2012 10:49:55 -0400 X-Google-Sender-Auth: iks-kjsHX7QjLGQ8DZLD4WeJqF4 Message-ID: Subject: Re: Changes to iOS PluginResult sending From: Michal Mocny To: callback-dev@incubator.apache.org Content-Type: multipart/alternative; boundary=f46d042de5612bf9c504cb50fcd5 X-System-Of-Record: true X-Gm-Message-State: ALoCoQkDJ8Xh40GywdUsnV8vXTQ47oLUjpQuwJtHbOE8HxMQ220Osy280Qs3Ohazd2lFdqf6TZsCF+Hlooy3oIfRYPHhWYNhh5evoIrGtSew9ce+pSIH7/oBWbwLZP/zANnBXMU3dpTXaVhR6hXWzNvk8m+Qi+OHGyCZqVX1zKq24uRCK5ffi9ewsH13j5QKEyrlzlEniBsP26MhgW3Q7s3uTib4yHuZUQ== X-Virus-Checked: Checked by ClamAV on apache.org --f46d042de5612bf9c504cb50fcd5 Content-Type: text/plain; charset=ISO-8859-1 For those who didn't click the bug link to read the full benchmarks, I'll summarize: If exec() is called from the context of a plugin result callback: perf improved *3x* [IFRAME_NAV] *6x* [XHR_NO_PAYLOAD] If exec() is called not from the context of a plugin result callback: perf improved *66%* [IFRAME_NAV] *33%* [XHR_NO_PAYLOAD] Excellent work Andrew! On Thu, Oct 4, 2012 at 7:06 PM, Filip Maj wrote: > Sweet that sounds good > > On 10/4/12 2:20 PM, "Shazron" wrote: > > >+1 > > > >On Thu, Oct 4, 2012 at 2:18 PM, Brian LeRoux wrote: > >> nice! looks great andrew > >> > >> On Thu, Oct 4, 2012 at 10:48 PM, Andrew Grieve > >>wrote: > >>> TLDR: Added a new method for plugins to use to send plugin results to > >>>JS. > >>> > >>> I've done some work to try and optimize the exec() bridge on iOS: > >>> https://issues.apache.org/jira/browse/CB-1579 > >>> > >>> The main goal of the change: whenever > >>>stringByEvaluatingJavascriptString is > >>> used to call a JS callback, poll for exec() messages using the return > >>>value. > >>> > >>> The two ways plugins sent results in before my change: > >>> > >>> Before my change, plugins would send results using either: > >>> [self success:pluginResult callbackId:callbackId] > >>> or (more commonly) > >>> [self writeJavascript:[pluginResult toSuccessCallback:callbackId]] > >>> > >>> > >>> Both of these returned a string, which means I had to create a new > >>>method > >>> that could take advantage of the optimization. > >>> > >>> So, the new fancy: > >>> [self.commandDelegate sendPluginResult:pluginResult > >>>callbackId:callbackId]; > >>> > >>> And for custom JS callbacks: > >>> [self.commandDelegate evalJs:js]; // has a void return value. > >>> > >>> > >>> sendPluginResult: and evalJs:js have the extra bonus that they are > >>> thread-safe and they work around cases where an alert() in the JS > >>>callback > >>> would result in dead-lock. > >>> > >>> I've left both of the old signatures so as to not break third-party > >>> plugins, but did go and update all of the core plugins. I'd like to > >>> deprecate them. I'll go ahead and do that tomorrow probably. > >>> > >>> I plan on updating the plugin guide to use this new method. > > --f46d042de5612bf9c504cb50fcd5--