Editing 1691: Optimization

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 8: Line 8:
  
 
==Explanation==
 
==Explanation==
βˆ’
In computing, {{w|program optimization}} is the practice of making a computer program work as quickly as possible, typically by designing it to perform the fewest calculations. "{{w|Premature optimization}}" is the practice of trying to optimize parts of a program before such optimization has been shown to be needed. Optimization can prove to have been a waste of time if parts of the program are later changed or discarded, or if the optimized code is only a small part of the workload. Making a routine 10 times faster doesn't help much if that routine is only consuming 1% of the running time to begin with and it may result in more complicated and buggier code.
+
In computing, optimization is the practice of making a computer program work as quickly as possible, typically by designing it to perform the fewest calculations. "Premature optimization" is the practice of trying to optimize parts of a program before such optimization has been shown to be needed. Optimization can prove to have been a waste of time if parts of the program are later changed or discarded, or if the optimized code is only a small part of the workload. Making a routine 10 times faster doesn't help much if that routine is only consuming 1% of the running time to begin with and it may result in more complicated and buggier code.
  
 
This comic is a flowchart making fun of the difference between prematurely optimizing and doing things right in the first place: it tells you that if you are using it to decide whether you are optimizing prematurely, then you're optimizing prematurely. The humorous conclusion is that if there is any doubt whether an optimization is ''premature'', then it is ''premature''!
 
This comic is a flowchart making fun of the difference between prematurely optimizing and doing things right in the first place: it tells you that if you are using it to decide whether you are optimizing prematurely, then you're optimizing prematurely. The humorous conclusion is that if there is any doubt whether an optimization is ''premature'', then it is ''premature''!

Please note that all contributions to explain xkcd may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see explain xkcd:Copyrights for details). Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel | Editing help (opens in new window)