next up previous
Next: Specification and Testing Up: The GNU C++ Library Previous: Containers

Performance

It is not very hard to come up with a basic data structures library. Programming techniques for implementing most components are familiar to most programmers. It is another matter to design and implement a library containing among the best data structures and algorithms known for supporting common applications. Libg++ includes both ``elementary'' structures such the obvious implementations of lists, complex numbers, etc., as well as ``fancy'' ones including balanced trees, self-adjusting arrays, and sophisticated random number generators. Nearly all of these are implemented in a completely interoperable fashion. For example, programmers may switch from a simple array-based implementation of Sets to one based on SplayTrees with very little effort, without caring at all about why splay trees happen to speed up their application. Of course, it might be that simple arrays are faster. One reason for including so many different implementations is that general-purpose library classes are used in a much broader range of contexts than are application-specific classes. The library writer has no idea of the expected execution profile and possible trade-offs. The best that can be done is to supply enough versions so that the likelihood of acceptable performance is high enough for the library to be considered useful.


next up previous
Next: Specification and Testing Up: The GNU C++ Library Previous: Containers


Doug Lea@Sun Apr 16 06:37:14 EDT 1995