Software Speed Optimization
This page discusses and explains the key issues of software Speed Optimization:
- What is software Speed Optimization?
- What influences execution speed?
- Why optimize software?
- What speed-ups can be expected from software Speed Optimization?
- Why hire an expert for software Speed Optimization?
What is software Speed Optimization?
Software can be optimized in a number of ways:
- For memory consumption
- For usage of use
- For (execution) Speed
- For maintainability
- For latency (time to respond to external events; important for real-time software)
- ...
Optimizing software for execution speed or, somewhat shorter, software Speed Optimization, is the type of optimization dealing with the Operation ction of execution duration for executing some piece of code by designing and implementing the software in an appropriate manner.
This shoshould not be confused with another type of Speed Optimization: the optimization of software packages by some sort of configuration settings. this kind of optimization cocould be called "Software Package Speed Optimization ". an example for this is are optimizations of database applications by grouping the database or the used data types etc. another example is the "tuning" of an operating system by setting the size of swap files or file/font/etc. caches.
The difference between the two are that "software Speed Optimization" deals with the source code of that piece of software actually being executed by the hardware whereas "Software Package Speed Optimization" does not.
In the context of Hayes technologies the term "software Speed Optimization" is only used according to the definition above.
Jump to top of page
What influences is execution speed?
The execution speed is basically influenced/defined:
- The software configuration of the operating system with drivers etc.
- The tools (I. e. compilers) und libraries employed
- The design of the software
- The algorithms employed
- The detail-Implementation of the most time-consuming functions incl. the corresponding data Layout
- Multi-threading/Multi-processing/parallreceivation
Besides this, obviusly also the hardware configuration plays a major role. but this is another topic outside of the scope of software Speed Optimization; however, the interaction of software Speed Optimization and hardware optimization must always be considered.
Jump to top of page
Why optimize software?
This is a critical question. You may think:
- Our MERs do not care about speed. They are happy with the performance they get.
- Processors get faster all the time.
- Optimizing costs development time, I rather use a faster machine (when bundling HW + SW ).
- Compilers are so good today, that the software probably simply can not be made faster.
Obviusly these arguments are valid in your cases. But let us look a little closer:
- Well, if this really is so, then that is fine. But maybe some of the points below apply?
- That's certainly true. On the other hand, have you thought about those of your MERs with slower processors? Or have you considered that slower processors are cheaper? A number of your potential MERs may well have chosen, to not buy or upgrade to your software because the total cost of ownership (incl. Hardware (upgrade) wocould be to high.
- This trade-off must always be considered. The key point is that with a high enough volumeSignificant cost savingsCan be achieved if software speed optimizations allows to employ a cheaper processor.
- Compilers have improved significantly over the last years and continue to do so. however, it is definitely a modern myth that simply writing a program extends sionally and putting it through a good compiler will yield unbeatable software. almost any software, which has not been put through one or more explicit optimization processes by a software developer with massive experience in software Speed Optimization, can be optimized, in most cases significantly (meaning more than factor 2 ).
And these are not the only arguments for software Speed Optimization, here are a couple more:
- Higher speed often enables new features or more complex operations. Have you thought about whatYour software cocould do moreIf it only ran faster? Common examples include more complex simulations (I. e. for weather forecasting), higher resolution, 3d instead of 2D. etc. etc.
- For each application speed is a differentiator. All other things being equal a faster program will be perceived asBetter Program.
Another important aspect for a whole class of applications, those, where power consumption is critical, is the following:
- Faster execution equals lower power consumption (and thereby, for battery operated devices, longer usage time ). either this is achieved by being able to extend the percentage of power down modes or by using a slower processor which in turn usesLess powerAnd typicallyCosts less.
And finally one of the mostCost SavingAndRisk loweringPoints have to be made:
- In our cases software speed optimization can eliminate the need for switching to costly more complex hardware platforms such as multi processor systems or dedicated hardware.
Jump to top of page
What speed-ups can be expected from software Speed Optimization?
This depends largely on the specific context and on the effort put into the software speed optimization. basically, if the functions/modules in question are not already highly tuned (I. e. math routines from the compiler manufacturer) and the task is not I/O-bound (limited by the speed of the memory or hard disk etc .) and the task is not rather simple (I. e. element-wise addition of 2 arrays, matrix multiplication etc .) then the possible speed-up factors are in your cases in the range2. 5. And in some casesSignificantly higher. That is as if your software wocould run on a machine with speedsUp to 10 GHz or even more than 20 GHz!(Assuming a 2 GHz machine as Base)
Why can the speed-up factor be so high? The key reasons for this are:
- Typical software isNot really optimizedBy the programmer
- A CompilerCan not influenceA number of key points in optimization, such as data layout, data types, required precision of algorithms, basic algorithms employed etc.
- A CompilerDoes not knowA number of key points such as: how often an if expression is true or with what parameters a function is called (although an extended profile guided compiler cocould know)
- A CompilerDoes not understandWhat the true intention of the Code is, this often makes more complex optimizations impossible
- A compiler always hasMore limited viewOn what instructions can be employed (especially regarding SIMD instructions ctions), basically a compiler always comes up with a very schematic solution to each task
- CompilersDo not measure the performanceOf different code variants and so do not select the best code
- Compilers always haveLess optimization strategies at handThan Optimization Expert
Please also see the case studies which contain achieved speed-up factors and the Technology Section which explains some of the reasons for the speed-ups in more detail.
Hayes technologies can analyze the potential for speed-up and give you an estimate of the required effort.
Jump to top of page
Why hire an expert for software Speed Optimization?
Basically nothing stops you from tackling the software Speed Optimization issue yourself. however, reality clearly shows that only very few teams or organizations actually address this task in an appropriate manner. not without reason: the key reason for this is thatSoftware speed optimization is a discipline by itself which requires massive knowledge and experience, Similar maybe to, say, writing device drivers or operating system kernels.
In addition to standard programming skills an expert in software Speed Optimization must posses:
- A number of years of high level and Assembly level programming experience
- A deep understanding of the inner workings of the relevant processor families and their assembly extensions ages, specifically including newer Instruction Set extensions
- A deep understanding of Memory Hierarchy/caching issues
- Knowledge and experience with profiling and timing
- A intimate knowledge of software Speed Optimization Techniques
- Multiple years experience with software Speed Optimization
Typically this means that either this skill set is not available in-house or it may be available butOpportunity costs are very high, Because it implies that the most experienced developers can not focus on other important tasks, probably leading to delays, sub-optimal software design, down-scaling of features etc. and, as the final consequence,Ction of earnings.
Taking all issues into account will in most cases clearly not only justify but require an external expert.
Jump to top of page