algorithm - Optimization! - What is it? How is it done? -


It's common to listen to "highly customized code" or to some developer, who needs to customize their and whatnot However, as a self-taught, new programmer, I've never really understood what people actually do while talking about such things.

It is to take care to explain this general idea? Apart from this, some recommend reading material and in fact you feel like saying on this matter. Feel free to rant and propagate.

customizable is a word that we use abruptly to mean "one Doing something good in a certain way "We rarely" optimize "something - and more, we improve it until it meets our expectations

Optimization Such There are changes which we do in the hope of optimizing some part of the program. A fully customized program usually means that the developer left the window to readability and to re-align the algorithm again in order to reduce the "wall time". (It is not a requirement that "optimized code" is difficult to read, it's just a trend.)

You can customize for one:

  • Memory

    CPU consumption - Algorithm computational less intensive.

  • The time of the wall - Whatever happens to something faster

  • Readability - Instead of improving your application for computers, you can make it easier for human beings to read.

Some common (and overly generational) technologies to optimize the code include:

  • Improve performance features Change algorithm to If you have an algorithm that takes time (O ^ 2) or space, try changing the algorithm that takes O (n * log n).

  • For example, if you have a string intensive app for memory consumption, going through code and viewing waste memory, you copy the allocation and copy from the original string Instead of switching to the substrings context (where there is an indicator in the string in a context, plus the indicator to determine its threshold) can be used.

  • To reduce CPU consumption, if you can, then many intermediate results of the cache. For example, if you need to calculate the standard deviation of a set of data, then to save that single numerical result each time you need to know std dev, instead of looping through the set .


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -