13 ms·
(disclaimer: I work for Adobe on a competing service (PhoneGap Build) and have worked with PhoneGap for years) This is a silly benchmark - there is absolutely
by alunny 15y ago
(disclaimer: I work for Adobe on a competing service (PhoneGap Build) and have worked with PhoneGap for years)
This is a silly benchmark - there is absolutely no reason you would put 1000 calls at once, sequential or parallel, across this sort of bridge in a real app. You probably shouldn't be calling any JavaScript API in a client-side app 1000 times at once.
The bridge in PhoneGap Android probably is slower than the one in Forge but
1) that's a tradeoff the PhoneGap devs were willing to make for wider compatibility, support for older devices, and isolation from the bizarre Android WebKit bugs that crop up in every release.
2) synthetic benchmarks aside, there's no indication this would affect the usability of the app.
Take the camera example in the article. A PhoneGap call (judging from the graphs) takes about 14ms, a Forge call about 3ms. That's for the entire round trip (JavaScript -> Native -> JavaScript), so divide each in half for each side of the trip.
With PhoneGap:
* first half of the trip (7ms)
* Android presents Camera activity, user picks a photo, Android returns control to original app (say, 500ms, very conservatively)
* second half of the trip (7ms)
= 514ms
With Forge:
* first half of the trip (1.5ms)
* Android presents Camera activity, user picks a photo, Android returns control to original app (500ms)
* second half of the trip (1.5ms)
= 503ms
This is much closer to a real-world use case - and the calls to native APIs entirely dominate the time spent on the bridge.
- gavingmiller 15y agoTotally agree with you on this one. On a side note, are there plans to develop a better set of debugging tools for PhoneGap? It's one of the major pains of the platform. If one is already in development can you point me in the proper direction? Thanks!
- willtheperson 15y agoRipple (http://ripple.tinyhippos.com/ http://ripple.tinyhippos.com/) does a pretty good job. You can get an extension for Chrome. It will simulate PhoneGap events and extend JS api's to support what iOS and Android should have. Kind of clunky but pretty useful.
- alunny 15y agoAgreed - I'd definitely like to see something like JSFiddle for PhoneGap. We're working on weinre right now - http://phonegap.github.com/weinre/ http://phonegap.github.com/weinre/ - and also recommend Aardowlf - https://github.com/lexandera/Aardwolf https://github.com/lexandera/Aardwolf - and Ripple - http://ripple.tinyhippos.com/ http://ripple.tinyhippos.com/
- lukifer 15y agoDebugging tools definitely need to be improved, but what I struggle with the most are memory/crashing bugs. XCode, for all its warts, provides sophisticated tools for handling this. Troubleshooting these issues on WebKit+PhoneGap is a miasma of trial and error, especially if the bug is hard to replicate on a desktop with 10 times as much RAM as a mobile device.
- jamesbrady 15y agoHey Andrew - a disclaimer of my own: I'm a co-founder of Trigger. Actually, we think this is a pretty important benchmark: battery drain and general responsiveness is a huge deal on mobile devices, so we take performance of the bridge very seriously. Every millisecond counts here. Also, I can absolutely see the need to send large number of messages - a streaming accelerometer API, for example, which is on our roadmap. You're right that there might be trade-offs between raw performance and supporting every quirk of every device. However, in this case, the Android bug you refer to only affects v2.3 emulators, not actual devices (to the best of our knowledge). We automatically set up our users with a v2.2 emulator to side step the problem. We think such significant performance gains for our users, and a much cleaner, easier to maintain codebase for us, is well worth it in this case.
- alunny 15y agore only affecting emulators: see @pmuellr's reply below - the bug in question affects 2.2 devices also. Since we're a community-driven open source project, you can see the discussion process :) http://groups.google.com/group/phonegap-dev/browse_thread/thread/8e44da7f150b4e45/b99b13e4f54e8036?lnk=gst&q=addJavaScriptInterface#b99b13e4f54e8036 http://groups.google.com/group/phonegap-dev/browse_thread/th... Again, "such significant performance gains for our users" is just FUD when you're talking about arbitrary benchmarks. An app built using Forge and PhoneGap, providing the same functionality, with the same UI layer, would be a much better measure of that. I'd be happy to be proven wrong.
- jamesbrady 15y agoThanks for the link - I can only see two mentions of 2.2 in that thread: one (in the first question) where the OP was asking about it, and another mention from Patrick, suggesting he think the issue only affects 2.3 phone using JSC. We don't know of any shipped phones that fall into that category. Remember, this post was called "Why Trigger.io doesn’t use PhoneGap" - it's about the reasons we chose not to live downstream from you, not just a post bashing what you've done. For us, the significant delta in performance is evidence of a different philosophy between what we are aiming for, and what you offer. We clearly want to make different design decisions, and need to be independent to do that properly.
- drzaiusapelord 15y agoWhoa a phonegap person! I hate to hijack, but are you guys seeing any of these apps rejected by Apple because they weren't made with native controls or any other reason? There's a project I'm going to begin working on and phonegap looks like a real time saver to me, but I don't want to have to deal with Apple telling me that my apps aren't "good enough" for them.
- MattRogish 15y agoWe've submitted hundreds of apps with PhoneGap and never had Apple reject due to PhoneGap. However, if your HTML/CSS looks terrible, Apple will probably reject you. Especially if it's just a static website app. Make it look nice and give it more functionality than a static website, and you should be fine. Thanks, -- Matt
- untog 15y agoThey tried to do that a few years ago, but nowadays they don't reject just because an app is web-based. I have one that's 95% HTML5 and it was approved absolutely fine.
- msh 15y agoI have a small phonegap app in the app store. It was approved without any problems.