0

I have a web application that has a lot of JavaScript code. As the content gets larger, some of the features start to get slower.

I can't seem to find out what is exactly taking too much time and freezes the browser for a second or two.

Currently, I am putting Date variables at different locations and subtracting them to see the parts that take too much time, but It is not helping me a lot.

I am aware of Chrome's Developer toolbar and firebug, but I don't know exactly how to use them to see processing time of codes and such...

Please help me to optimize my app and figure out where it chokes.

elixenide
45k16 gold badges79 silver badges103 bronze badges
asked May 12, 2014 at 14:36
0

2 Answers 2

1

For chrome dev toolbar press f12

  • go to network tab to see dl times.
  • And sources tab to debug code.
  • And profiles tab to record cpu usage

Or google for tutorials and just try it out.

answered May 12, 2014 at 14:51
Sign up to request clarification or add additional context in comments.

Comments

1

You can use console.time()

For instance:

console.time('yourFunction');
//Time what you'd like inbetween the statements
yourFunction();
console.timeEnd('yourFunction');

Alternatively (although you mentioned you've already used these), you can try the following native functions:
date()
getTime()
getMilliseconds()

answered May 12, 2014 at 14:51

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.