Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Contributor
Posts: 14
Registered: ‎02-09-2011
My Device: Not Specified
Accepted Solution

application slow on device, fast on simulator.

Hi,

 

I'm currently developing a webworks application and it extremely slow on the torch device. But working fine on the simulator.

 

By slow, I mean the ui takes atleast takes 3 second to respond after the touch gesture, either scrolling or clicking a button. And page transitions lag.

 

I'm currently using jquery and jquery mobile, could those be causing the problems?

Regular Visitor
Posts: 1
Registered: ‎03-20-2011
My Device: 9700 Bold

Re: application slow on device, fast on simulator.

Greetings,

 

I am facing a similar issue, my application loads normally on simulator, but when moved to the device it takes about 3-4 seconds each page to load, eventhough I am testing on local network (through WiFi).

 

The simulator and the device are the same: 9700 Bold.

 

n.b. I am using jQuery 1.5.1

 

Best regards,

Mohamad McHaimech

 

 

New Developer
Posts: 43
Registered: ‎01-14-2011
My Device: 9810, PlayBook

Re: WebWorks Phone application slow on device, fast on simulator.

Same issue here, with the same specs as mchaimech -- 9700 Bold, app uses jQuery 1.5.1.  It's only one page, but all actions are a little delayed, and one in particular (which resets some elements and redraws the page) is very slow.  Not bad on the simulator, just bad on actual hardware.  Very frustrating.

 

Anyone?

Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: WebWorks Phone application slow on device, fast on simulator.

The primary item that stands out to me with slow behavior of Web content in this context while running on a live device is processor - you do not have a simulator running on a developer machine powered by a strong processor (while on the Bold 9700 its a 624Mhz chip).

 

What exactly is jQuery 1.5.1 trying to do?  If it is heavy UI Javascript-based animation, there is a strong likelyhood it doesn't play nicely with a  mobile CPU?

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Developer
Posts: 164
Registered: ‎08-26-2010
My Device: Not Specified

Re: WebWorks Phone application slow on device, fast on simulator.

As i wrote in the prevous-similar thread before:


http://supportforums.blackberry.com/t5/Web-Development/Redirecting-between-local-pages-takes-a-long-...

 

it's not fair to compare between simulator and the real device,

because of its difference hardware.

Contributor
Posts: 22
Registered: ‎03-07-2011
My Device: Not Specified

Re: WebWorks Phone application slow on device, fast on simulator.

Hi, i am facing the same issue i have a web works application but the ui response is delayed 2 to 3 seconds, please if anyone of you has been able to solve this issue or have any tips for me than please help...

 

Thanks

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: WebWorks Phone application slow on device, fast on simulator.

My guess is that it is because you are using jQuery mobile on your page.  jQuery uses extremely LARGE amounts of DOM manipulation on the live DOM and doesn't "yet" use document fragments or remove sections of the DOM to manipulate it.

 

Layout computation on a mobile device is EXTREMELY expensive.  Every time you run a pice of JavaScript that manipulates the DOM (i.e. every line of JS code that changes an attribute or element in the DOM) it will have to re-compute the layout of the DOM even though it doesn't draw it on the screen until the JavaScript thread is done.

 

This is because the next line of code may be gathering measurements from the changes made on the previous line of code.

 

Here is a post where I explain it more and how you can get orders of magnitude speed increases by manipulating the DOM in a mobile efficient way.

 

http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/PLEASE-READ-PERFORMANCE-TIP-Spee...

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Contributor
Posts: 22
Registered: ‎03-07-2011
My Device: Not Specified

Re: WebWorks Phone application slow on device, fast on simulator.

Thanks alot man that was really what i was looking for, solved my problem though there was a minor problem that after removing an element from DOM I could not use any document method like document.getElementById(), found an other tutorial for solving the problem blackberry Webworks Performance Issue