What are some common performance issues regardless of programming language?

Normally, if my code has performance issues, I will follow the steps below to understand the reason.

  • top command to view processor usage
  • free command to view memory usage
  • add time information to code
  • print execution instructions in code
  • understand and improve the algorithm

What do you do if your code is very slow.

+3
source share
3 answers

1) ,
2) , , 2 .

+6

. .

+1

, , , - .

, , , , , .

, ,

  • accepts samples of the time stack on the clock (during I / O, as well as processor time),
  • when you want them (when it's slow, not all the time),
  • and reports on a line of code (and not just on function / method)
  • percentage of samples containing this line (not count, not time, not average time — percent).

Good Zoom .

Another very simple method is a random pause .

+1
source

Source: https://habr.com/ru/post/1795524/


All Articles