next up previous contents
Next: Str Internals Up: Benchmarks Previous: String Search Benchmark   Contents


The Str class has a noticeable performance improvement over gcc's implementation of string in most areas. When comparing to char*, performance is mixed, with Str coming ahead in some cases and char* coming out better in others. I believe the main benefit to Str is the stored length field that can accelerate many operations. The advantage to char* comes in the form of a simpler structure, direct compiler awareness, and a support library that has been performance tuned over several decades.

As always, the best choice for a project involves a careful trade-off of several contributing factors. I believe that the good performance, ease of use, and high safety of the Str class make it a good option for a number of situations.