1
Tuesday November 26 (Sessions 1 and 2)
1. #include dependencies vs. forward declarations
Include dependencies:
#include “random_number_generator.h”
struct Something {
Random_Number_Generator generator;
};
Forward declaration:
struct Random_Number_Generator;
struct Something {
Random_Number_Generator *generator;
};
Forward declaration provides a tremendous increase in speed when used consistently in a large project. The disadvantage is that the compiler doesn’t know the size of the forward-declared type, so you can’t use that type directly in the header. You must instead use a pointer to the type. So the semantics of your program are affected (you need to dynamically allocate things sometimes when you might prefer not to). This way in which compile-speed concerns bleed into the semantics of your program can be viewed as a general weakness of C++.
2. Compiler timing experiments performed by Casey Muratori of RAD Game Tools
Date: Wed, 20 Sep 2000 19:09:24 -0400 (EDT)
From: Casey Muratori
Recently, I decided to run some very simple tests on my machine to get a baseline for just how bad the STL (and templates in general) can be. Even on my 1gHz machine with a supposedly super-fast memory subsystem and all that mumbo jumbo, I was able to bring the compiler to its knees with some very simple STL statements. Simple things like including and instantiating a std::string bloated compile time by a half a second per file, which can really add up for large projects. Instantiating something like std::map was far worse, bloating compile time by more than a second per file. And, needless to say, over-the-top STL statements like std::list ................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- florida international university
- results of eee fall 2004 research harvey mudd college
- chapter 2 the basics of c programming
- dwarf debugging information format v4
- Структури даних
- cse 2320 notes 1 algorithmic concepts
- welcome to the department of computer science computer
- ΑΣΚΗΣΗ 8 Βρόγχοι Επανάληψης
- assignment 1 carleton university
Related searches
- 1 or 2 374 374 1 0 0 0 1 168 1 1 default username and password
- 1 or 3 374 374 1 0 0 0 1 168 1 1 default username and password
- 1 or 2 711 711 1 0 0 0 1 168 1 1 default username and password
- 1 or 3 711 711 1 0 0 0 1 168 1 1 default username and password
- 1 or 2 693 693 1 0 0 0 1 168 1 1 default username and password
- 1 or 3 693 693 1 0 0 0 1 168 1 1 default username and password
- 1 or 2 593 593 1 0 0 0 1 or 2dvchrbu 168 1 1 default username and password
- 1 or 3 593 593 1 0 0 0 1 or 2dvchrbu 168 1 1 default username and password
- 1 or 2 910 910 1 0 0 0 1 168 1 1 default username and password
- 1 or 3 910 910 1 0 0 0 1 168 1 1 default username and password
- 192 1 or 2 33 33 1 0 0 0 1 1 1 default username and password
- 1 or 2 364 364 1 0 0 0 1 168 1 1 admin username and password