Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Profile mobile Safari (iPad) javascript?

Javascript performance on mobile Safari (iPad) is much more sensitive for my application that it is on the desktop. Some operations that work super-smooth on the desktop take a while on the iPad, and I'd like to track down where the bottlenecks are. Is there some way to profile Javascript code on the iPad?

like image 654
Ben Dilts Avatar asked Mar 21 '11 22:03

Ben Dilts


People also ask

Why is JavaScript not working in Safari on iPad?

On an iPad and an iPhone JavaScript is default disabled! When you enable JavaScript an Cookies in your Safari browser, logon will probably be successful. To enable JavaScript on your iPad or iPhone choose Settings, Safari and Advanced; to adjust Cookies choose Settings, Safari and uncheck Block Cookies.

Should I Enable JavaScript on Safari?

Enabling Javascript can help you view web pages properly — without it, many websites and programs may not load. It should only take a minute or so to enable Javascript in Safari on your Mac.

How do I open the JavaScript console on my iPad?

Apple Safari To do that, go into Safari's preferences (Safari Menu > Preferences) and select the Advanced Tab. Once that menu is enabled, you will find the developer console by clicking on Develop > Show Javascript Console.


1 Answers

If you have access to an Android phone, you can profile your application using desktop Chrome's developer tools and a USB cable (very convenient).

Android and iPhone behave+perform similarly, but not identically. That said, for 90% of use cases, if you improve performance on Android, you'll see the same improvements on iPhone.

Hour for hour, at least for the first pass of profiling, I think you'll get better results on iPhone using chrome+android to profile than using a less rich toolset.

https://developers.google.com/chrome/mobile/docs/debugging

It'll require Chrome, an Android device able to run the android Chrome app, and a USB cable.

You have to install and use the ADB console command, but once its working, you'll have the full chrome developer tools interface available for debugging mobile.

like image 183
Seth Avatar answered Oct 14 '22 06:10

Seth