2

There seem to be a lot of tools to check how much time it takes to load a specific script, but what about performance impact on the user's machine? Does anyone know of any tools to see the CPU demands of a specific script, especially on mobile?

As I write apps, I feel like I'm trying my best to cut down on unnecessary logic, but I have a hard time knowing how I'm doing — and whether the end user's experience will be smooth — with no CPU benchmarks or guidelines.

ibhhvc
  • 255
  • 2
  • 12
  • A better approach would be to actually run the app and see where the experience is smooth and where it is not, then focus on those areas. –  Jan 11 '16 at 15:30
  • That makes a lot of sense. But this means getting access to a slower computer, multiple older-phones etc. Or is there a way to emulate slower machines/phones? – ibhhvc Jan 11 '16 at 16:00

2 Answers2

2

There are some tools out there but if you are using chrome you already have a great one installed: https://developer.chrome.com/devtools/docs/timeline

Miquel Adell
  • 1,132
  • 3
  • 11
  • 24
  • Yes, thanks! I've been using timeline to analyze loading, but I just didn't realize you could hit record for events at any time. – ibhhvc Jan 11 '16 at 16:07
  • Adding to that, do you know how CPU time translates into performance on slower machines? I'm assuming chrome is telling me that it took _my_ computer that amount of CPU time to run the script. How does this translate to how much CPU time a phone, say, would take? Or do I just have to test on other devices and see? – ibhhvc Jan 11 '16 at 16:09
0

You can simply use profiling browser tools (like in Firefox right click-> Inspect element and choose performance tab).

Or you can measure your functions performance by using High Resolution Time API

IBelous
  • 80
  • 1
  • 7