Performance problem and concurrency call to phonegap and the DOM

55 views
Skip to first unread message

Samuel Michelot

unread,
Jan 6, 2010, 9:58:56 AM1/6/10
to phonegap
Hi all !

Again, thanks a lot for phonegap, it's really helpful, my app is
nearly ready now, but I have some strange and tough problem to solve
before submitting my app to Apple:

First of all, I use JQTouch with phonegap edge.

So I have some random display problem when I call phonegap function,
but only in the real device (not in the simulator).

My first hypothesis is that if I call a phonegap function, and at the
same time I try to access the DOM with JQuery, it will not work. And
the simulator is faster, that's why it happens less frequently

For example, if I activate my logging (with the phonegap JS function
debug.log('blabla')), some JQuery access (ex. $('#id').html('new
value') ) doesn't work some time (as if it was a matter of time and
concurrency).


Do you think it's possible? I know it's a difficult bug to understand,
but I am really stuck with that, so any help will be appreciated.

Thanks,

Sam

memibeltrame

unread,
Jan 6, 2010, 10:30:31 AM1/6/10
to phonegap
Hi Sam
I am having similar problems, race conditions on startup and general
slowness of touch interactions. Maybe what i found out might help you
too

Note:
http://blogs.nitobi.com/jesse/2009/10/28/running-jqtouch-in-phonegap/
According to this Post the accellerometer has a frequency of 40
notifications per second. if disabled startup is a bit smoother.
Also consider that touch interactions have a delay and should rather
be called through touchstart rather than click.
http://cubiq.org/remove-onclick-delay-on-webkit-for-iphone/9
i sort of managed to make it work, but have scope issues now...

hope that helps in some way. generally i am really baffled how slow
everything is.

Cheers
Memi

Samuel Michelot

unread,
Jan 7, 2010, 4:20:50 AM1/7/10
to phonegap
Thanks Memi for your answer.
I am aware of this links, I have of course disabled Accellerometer and
I use the tap event of JQTouch (inspired by the cubiq article).
Actually I don't really have performance problems, but more as you say
race condition at startup, and some random bugs of JQuery when I call
phonegap function (like logging or tabbar function).
I need to investigate more, but don't really know where to look.

PS : my app is working very well in iPhone navigator.

On 6 jan, 16:30, memibeltrame <memibeltr...@gmail.com> wrote:
> Hi Sam
> I am having similar problems, race conditions on startup and general
> slowness of touch interactions. Maybe what i found out might help you
> too
>
> Note:http://blogs.nitobi.com/jesse/2009/10/28/running-jqtouch-in-phonegap/
> According to this Post the accellerometer has a frequency of 40
> notifications per second. if disabled startup is a bit smoother.
> Also consider that touch interactions have a delay and should rather

> be called through touchstart rather than click.http://cubiq.org/remove-onclick-delay-on-webkit-for-iphone/9

Samuel Michelot

unread,
Jan 12, 2010, 7:01:09 AM1/12/10
to phonegap
After multiple tests, it happens that the html() method of jquery
doesn't work every time in phongap. (this is a little scary...)

But the solution I found is to replace :
$('mySelector').html('my html code');
by
$('mySelector').get(0).innerHTML = 'my html code';

Hope this help

Reply all
Reply to author
Forward
0 new messages