Optimizing C and C++ Code Embedded software often runs on processors with limited computation power, thus optimizing the code becomes a necessity. In this article we will explore the following optimization techniques for C and C++ code developed for Real-time and Embedded Systems. - Adjust structure sizes to power of two
- Place case labels in narrow range
- Place frequent case labels first
- Break big switch statements into nested switches
- Minimize local variables
- Declare local variables in the inner most scope
- Reduce the number of parameters
- Use references for parameter passing and return value for types bigger than 4 bytes
- Don't define a return value if not used
- Consider locality of reference for code and data
- Prefer int over char and short
- Define lightweight constructors
- Prefer initialization over assignment
- Use constructor initialization lists
- Do not declare "just in case" virtual functions
- In-line 1 to 3 line functions
|
|
Read more...
|
|
Code Optimization Using the GNU C Compiler This article describes some of the code optimization techniques used by the GNU C Compiler, in order to give the reader a feel of what code optimization is and how it can increase the efficiency of the generated object code. Contents - Introduction
- Assembly Language Code for a C Program
- Constant Folding
- Common Subexpression Elimination
- Dead Code Elimination
- Strength Reduction using Induction Variable
- Conclusion
- Acknowledgments
- References
|
|
Read more...
|
|
C optimisation tutorial This document has evolved over time and contains a number of the best ways to hand-optimise your C-code. Compilers are good, but they can't do everything, and here I hope to help you squeeze the best performance out of your code. This is not intended for beginners, but for more experienced programmers.
|
|
Read more...
|
|
Origins of UNIX In 1969, Ken Thompson from AT&T’s Bell Telephone Labs wrote the first version of the UNIX operating system, on a DEC PDP-7. Disillusioned with the inefficiency of the Multics (Multiplexed Information and Computing Service) project, Thompson decided to create a programmer-friendly operating system that limited the functions contained within the kernel and allowed greater flexibility in the design and implementation of applications. The PDP-7 was a modest system on which to build a new operating system. it had only an assembler and a loader,and it would allow only a single user login at any one time. It didn't even have a hard disk, the developers were forced to partition physical memory into an operating system segment and a RAM disk segment.
Thus, the first UNIX file system was emulated entirely in RAM!
|
|
Read more...
|
|
Security Considerations with Diameter This memo does not describe a stand-alone protocol, but a particular application for the Diameter protocol [RFC3588]. Consequently, all the security considerations applicable to Diameter automatically apply to this memo. In particular, Section 13 of RFC 3588 applies to this memo.
This Diameter SIP application allows a Diameter client to use the properties of HTTP Digest authentication [RFC2617] by evaluating or sending to the Diameter server the credentials supplied by a user. The discussion of HTTP Digest authentication in Section 4 of RFC 2617 [RFC2617] is also applicable to this memo.
|
|
Read more...
|
|
|
|
<< Start < Prev 1 2 3 4 5 6 7 8 9 10 Next > End >>
|
| Results 53 - 65 of 275 |