Tip 1 - Always Create Benchmarks for Comparison
The need to create benchmarks for comparing optimization results is obvious. It is surprising that development teams often rush to optimize without any benchmarks. Benchmarking is important because every time the optimization gets smaller and smaller. For example, the first energy optimization may have a 20% improvement, the second 10%, the third 5%, and so on. Developers should understand this trend and quantify the improvements they have gained in the system as a function of the number of inputs.
Tip 2 - Set optimization goals
Each optimization takes more time than the previous one to get a minimal amount of improvement from the system. The development team needs to carefully balance their time commitments and determine whether it is worth the time spent on improving results. It's easy to get obsessed with stuffy stuff and it may take weeks to realize that you're optimizing a system that no longer needs optimization. Therefore, before the optimization begins, the development team should set a target value. To achieve this goal, it means that the optimization result is good enough for the current application and the optimization process has been completed.
Tip 3 - Use the Right Measurement Tool
Without a suitable measurement tool, it is difficult to optimize a system. For example, if you do not use a precise method to measure the energy consumption of the system and the microcontroller, it is difficult to complete energy optimization. Developers often cannot distinguish between these two different energy measurements, and they try to reduce the power consumption of microcontrollers that are virtually impossible to reduce.
Developers interested in performance tuning can take a look at the Segger system review tool I introduced in "Hands-on: Segger System Viewing Tool" which is useful for understanding which functions are monopolizing the CPU. Without tools that can accurately measure or allow developers to see the behavior of the system, they can't grasp the focus when optimizing the system.
Tip 4 - Using Optimization Tools
To reduce code size or improve performance, many aspects of embedded software can be optimized. In some cases separate or attached tool chains can be used. The Somnium DRT optimizer is a good optimization tool that can be used with GCC to optimize code size, energy usage, and performance.
However, sometimes external tools may not be necessary, as long as the correct toolchain is chosen. I recently wrote an article entitled "Open Source and Commercial Compilers" that illustrates the fact that in Coremark testing, commercial compilers always score higher than the same microcontroller and the same test conditions. Open source compilers such as GCC.
Tip 5 - Use Compiler Properties and #pragma Instructions
I generally do not like to use #pragma directives or compiler properties. Properties and #pragma directives are usually not portable, and changing the compiler can cause software bugs. However, developers often have no choice when adjusting embedded software. Using attributes and #pragma instructions can increase speed and selectively optimize a function based on actual conditions. For these reasons, developers who want to optimize their software should be familiar with the use of attributes, and they should read “Programming Portable Optimum Programs in C†so that they know how to write portable and optimal programs without negative impact. .
Tip 6 - Do more experiments
There is no static method for optimizing the system. Developers should not be limited to any particular technology. Sometimes the best way to learn and optimize the system is to try out various experiments and analyze the results.
When I first optimized the system for low power consumption, I did a lot of experiments, and I also made some mistakes. Through the experimental process and the recorded results, I can understand what is useful, what is not, and what is done is a waste of resources and time. How to make the best use of printf is a simple example: By experimenting with different driver models, you can see that many methods can significantly increase the real-time performance that developers use when working with printf, and people tend to think that the results are usually far better than the actual results.
Tip 7—Dive into the compiler-generated instructions
In applications where resources are particularly limited, developers sometimes only need to roll up their sleeves to gain insight into the compiler-generated instructions. There is a difference in choosing a ternary operator instead of if/else between the three or four generalized instructions that will be executed, which is likely to cause the application to crash.
Although languages ​​such as C are standard, each compiler is slightly different when optimizing and generating machine instructions. The only realistic way is to check the assembly language and see what the compiler is doing.
to sum up
Different applications have different optimization needs. Applications generated in small batches may not require optimization at all; for other applications, each clock cycle or current per nanoamperes is important, and developers may spend a lot of time squeezing the last bit of performance from the system or energy. Although each type of system is different, developers who have memorized these techniques are making a promising first step towards a more efficient system.
UCOAX DisplayPort cables transmit high definition audio and video from your computer to a monitor for video streaming or gaming;
The Display cable connects and configures your monitor for an Extended Desktop or Mirrored Displays.
Gold-plated connectors, bare copper conductors, and foil & braid shielding combine together to provide both superior performance and reliable connectivity of the DisplayPort 1.2 cable.
Flexiable length make your work and life easier.
Dp Cables,Dp To Dp Cable,Mini Dp To Dp 1.4 Cable,Dp Cable
UCOAX , https://www.jsucoax.com