Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Doesn all the safety of Bstrlib lead to increased overhead versus standard char buffer usage?

0
Posted

Doesn all the safety of Bstrlib lead to increased overhead versus standard char buffer usage?

0

A. Bstrlib uses a (length, data) internal representation rather than ‘\0’ termination. Because of this, functions which require length determinations have dramatically improved performance versus the corresponding standard C library functions (see the benchmarks in the feature comparisons page.) Where performance is concerned, this means that string manipulations of strings that are not very small will favor Bstrlib. In addition, the Bstrlib API is substantially more functional than the C library. This means that function call overhead is better amortized (by virtue of not needing to call as many such functions) than the C library. A minimum useage of Bstrlib measured on a variety of compilers shows an additional object code size of between 18k and 28K. All this being said, manipulations that are extremely trivial, on very small strings may execute marginally faster just using the straight C library.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.