Writing efficient C code : a thorough introduction for Java programmers
Writing efficient C code : a thorough introduction for Java programmers
- Java programmers who want to learn C from the beginning, and
- practicing C programmers who want to sharpen their skills.
We present essentially all of C99 and the new revision of the C standard, called C11. In addition to C, we introduce elementary computer architecture and essential C development tools including the
gcc
compiler, the gdb
debugger, profilers, and the Valgrind suite of tools for performance analysis and automatic detection of software defects. Using performance measurements and a deep knowledge about which code transformations optimizing compilers can perform automatically, as well as their limitations, as the basis for the method for writing efficient C code, the readers of this book will hopefully become more productive and more competent in writing correct, maintainable and fast C code.
In order to achieve this goal, and to help C programmers visualize the machine code and the clock cycle counts of their code, the book contains one chapter on the internals of modern optimizing compilers, and the necessary background on how C is translated to machine code for a RISC processor.
Additional information about the book can be found at
http://writing-efficient-c-code.com
.Prerequisites
The reader is assumed to have studied computer programming e.g. with Java, which is used in the first chapter for explaining the key concepts of C.
About the authors
Dr. Jonas Skeppstedt has done research on optimizing compilers and multicore computer architecture in Lund, Chalmers, and USC in Los Angeles; his
lmpcc
compiler was rewarded ISO C certification in 2003 for C99; has taught C programming at Lund University for many years and has developed safety-critical C code for the new European Rail Traffic Management System (ERTMS), and helped German lawyers as expert witness on the C programming language.
Christian Söderberg has been teaching programming at Lund University for 20 years.