background preloader

Optimizing C and C++ Code

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. Many techniques discussed here have roots in the material we covered in the articles dealing with C to Assembly translation. A good understanding of the following articles will help: Premature optimization is the root of all evil Donald Knuth wrote, "Programmers waste enormous amounts of time thinking about, or worrying about, the speed of noncritical parts of their programs, and these attempts at efficiency actually have a strong negative impact when debugging and maintenance are considered. In general, correctness and readability considerations trump code performance issues for most of your code. Adjust structure sizes to power of two Place case labels in narrow range Place frequent case labels first Splitting a switch statement

BeginnersGuide New to programming? Python is free and easy to learn if you know where to start! This guide will help you to get started quickly. Chinese Translation/中文版入门 New to Python? Read BeginnersGuide/Overview for a short explanation of what Python is. Getting Python Next, install the Python 3 interpreter on your computer. There are also Python interpreter and IDE bundles available, such as Thonny. At some stage, you'll want to edit and save your program code. Learning Python Next, read a tutorial and try some simple experiments with your new Python interpreter. If you have never programmed before, see BeginnersGuide/NonProgrammers for a list of suitable tutorials. Most tutorials assume that you know how to run a program on your computer. Some sites offer in-browser coding for those who want to learn Python: Print a cheat sheet of the most important Python features and post it to your office wall until you know the basics well. Need Help? Need help with any of this? Complete list of Beginner's Guide pages

The GNU C Library Node: Top Next: Introduction Prev: (dir) Up: (dir) This is Edition 0.06 DRAFT, last updated 24 October 1994, of The GNU C Library Reference Manual , for Version 1.09 Beta of the GNU C Library. Introduction Purpose of the GNU C Library. Error Reporting How the GNU Library functions report error conditions. Memory Allocation Your program can allocate memory dynamically and manipulate it via pointers. Character Handling Character testing and conversion functions. String and Array Utilities Utilities for copying and comparing strings and arrays. Extended Characters Support for extended character sets. Locales The country and language can affect the behavior of library functions. Searching and Sorting General searching and sorting functions. Pattern Matching Matching wildcards and regular expressions, and shell-style ``word expansion''. I/O Overview Introduction to the I/O facilities. Streams High-level, portable I/O facilities. Low-Level I/O Low-level, less portable I/O. File System Interface Pipes and FIFOs Sockets Names

Classification Web (Cataloging Distribution Service - Library of Search, browse, and access all Library of Congress Classification schedules and Library of Congress Subject Headings and Name Headings on the Web. Construct, verify, and assign classification numbers, subject headings, and name headings to library material using the most current data. Classification Web is the only web-based subscription service to offer you all this—and it’s updated every day. Free trial for 30 days Some of the Classification Web advantages: Full-text display of all LC Classification schedules, subject headings, and name headings. See a full listing of the Classification Web features Testimonials CDS Customer Satisfaction Survey (CDS Survey).

Dennis Ritchie Home Page Location Dennis Ritchie Bell Labs, Rm 2C-517 600 Mountain Ave. Murray Hill, New Jersey 07974-0636, USA dmr@bell-labs.com +1 908-582-3770 (office), +1 908-582-5857 (fax) In Memoriam Dennis died in early October, 2011. As Dennis's siblings, Lynn, John, and Bill Ritchie--on behalf of the entire Ritchie family--we wanted to convey to all of you how deeply moved, astonished, and appreciative we are of the loving tributes to Dennis that we have been reading. Dennis was an unfailingly kind, sweet, unassuming, and generous brother--and of course a complete geek. We are terribly sad to have lost him, but touched beyond words to realize what a mark he made on the world, and how well his gentle personality--beyond his accomplishments--seems to be understood. Lynn, John, and Bill Ritchie History For many years, I worked in the Computing Sciences Research Center of Bell Labs. Soon after, Ken Thompson, together with me and others, first started work on Unix. Lucent and Alcatel merged as of Dec 1, 2006.

Salamandra robotica Top 10 Ways to be Screwed by &quot;C&quot; To get on this list, a bug has to be able to cause at least half a day of futile head scratching, and has to be aggravated by the poor design of the "C" language. In the interests of equal time, and to see how the world has progressed in the 20-odd years since "C" escaped from its spawning ground, see my Top 10 Ways to be Screwed by the Java programming language, and for more general ways to waste a lot of time due to bad software, try my Adventures in Hell page. A better language would allow fallible programmers to be more productive. Non-terminated comment, "accidentally" terminated by some subsequent comment, with the code in between swallowed. a=b; /* this is a bug c=d; /* c=d will never happen */ Accidental assignment/Accidental Booleans if(a=b) c; /* a always equals b, but c will be executed if b! Closely related to this lack of rigor in booleans, consider this construction: if( 0 < a < 5) c; /* this "boolean" is always true! Or consider this: if( a =! Unhygienic macros or as Oops.

robots.net - Robot news and Robotics Info Programming in C A. D. Marshall 1994-2005 Substantially Updated March 1999 Next: Copyright Keyword Searcher Click Here to Download Course Notes. Direct link to Java Algorithm Animations (C related) Lecture notes + integrated exercises, solutions and marking Useful Links C tutorial for reference for beginners About this document ... RIA - Robotics Online - Your #1 Online Resource for Industrial R perftools - Google Code These tools are for use by developers so that they can create more robust applications. Especially of use to those developing multi-threaded applications in C++ with templates. Includes TCMalloc, heap-checker, heap-profiler and cpu-profiler. Recent news: 19 Apr 2014 gperftools 2.2rc is out! Here are notable changes since 2.1: a number of fixes for a number compilers and platforms. The following people helped with ideas or patches (based on git log, some contributions purely in bugtracker might be missing): Andrew C. 30 July 2013 gperftools 2.1 is out! Just few fixes where merged after rc. Some fixes for debug allocation on POWER/Linux 20 July 2013 gperftools 2.1rc is out! As a result of more than a year of contributions we're ready for 2.1 release. But before making that step I'd like to create RC and make sure people have chance to test it. Here are notable changes since 2.0: fixes for building on newer platforms. 06 February 2012 Hello from your new maintainer. -Dave 03 February 2012 26 August 2011

ANDROID, Artificial Intelligence - Research - Osaka University Where does the feeling of one's presence, such as the atmosphere or the authority of a person come from? How can it be captured, revived, and transmitted? To tackle this mystery, we have developed a new real-person based android, “Geminoid”. A geminoid appears and behaves just like its source person. Also, it is tightly-connected with its original by information paths. Research using androids requires various information on their "source": from their physical natures to social relationships, in detail. Since artificial intelligence technology has still not reached the level of adult mankind, robots can only respond in quite a simple manner. Research with geminoids take two approaches: One is with the engineering approach, such as development of effective tele-operation interface or generation of natural, humanlike motion.

Getting Started with LLVM System Overview Welcome to LLVM! In order to get started, you first need to know some basic information. First, LLVM comes in three pieces. The first piece is the LLVM suite. The second piece is the Clang front end. There is a third, optional piece called Test Suite. Requirements Before you begin to use the LLVM system, review the requirements given below. Hardware LLVM is known to work on the following host platforms: Note Code generation supported for Pentium processors and upCode generation supported for 32-bit ABI onlyTo use LLVM modules on Win32-based system, you may configure LLVM with --enable-shared.MCJIT not working well pre-v7, old JIT engine not supported any more. Note that you will need about 1-3 GB of space for a full LLVM build in Debug mode, depending on the system (it is so large because of all the debugging information and the fact that the libraries are statically linked into multiple tools). The LLVM suite may compile on other platforms, but it is not guaranteed to do so.

The Cognitive Robot Companion Cognitive Robots Companions: a vision 'Developing cognitive robots whose "purpose in life" would be to serve humans as assistants or "companions". Such robots would be able to learn new skills and tasks in an active open-ended way and to grow in constant interaction and co-operation with humans. (excerpt of the European Commission's 'Beyond Robotics' workprogramme The development of a robot, which would serve humans in their daily life, poses several important challenges to Robotics and Artificial Intelligence. As a mechatronic device, the robot should of course be endowed with mobility and manipulation capacities in human environments. The dynamics of the tasks it has to achieve, of the situations, and of the interactions with humans, imply that such a robot companion will have to exhibit cognitive capacities for adapting its behaviour in changing situations and for various tasks. To see the project's vision in a video click here. (credits: LAAS-CNRS)

The Cognitive Robot Companion Research and technological development efforts in COGNIRON have a strong focus on basic research. To reach the project objectives of developing a cognitive robot companion, and in order to understand and implement the fundamental processes enabling cognition in artificial embodied artefacts, the project will adress the issues of representations, understanding, reasoning, and learning mechanisms and interaction with humans and other agents. The scope of the project is broad as a cognitive robot companion, beyond the necessary functions for sensing, moving and acting will exhibit the cognitive capacities enabling it to focus its attention, to understand the spatial and dynamic structure of its environment, to interact with it, to exhibit a social behaviour and to communicate with other agents and with humans at the appropriate level of abstraction, according to a given context. Overview of COGNIRON project structure RA7 : Systems level integration and evaluation (leader : IPA)

Related: