next up previous contents
Next: String Length Benchmark Up: Benchmarks Previous: Benchmarks   Contents

Allocation Benchmark

Figure 2.1: This figure shows the amount of time required to allocate space for a small string and populate it with "Hello World"
\begin{figure}\begin{center}
\epsfig{file=Allocate.eps, width=4.5in}\end{center}\end{figure}

Figure 2.1 shows relative the relative performance of creating a string and populating it with the contents "Hello World". This type of test is where the simple structure and tight compiler integration of a stack-based char* become an advantage, allowing for excellent performance. There is also a noticeable improvement in using a stack Str over a heap-based one. The standard string class has the lowest performance in this test, a trend that continues throughout the benchmark.



2007-05-05