Re: Please help with testing & improving a StringValue class
* Alf P. Steinbach:
An 02 version of StringValue is now available at
<url: http://home.no.net/alfps/cpp/lib/alfs_v02.zip>.
An 03 version of StringValue is now available at
<url: http://home.no.net/alfps/cpp/lib/alfs_v03.zip>.
This version is mainly just a name change, reflecting that wchar_t is
now the /natural/ character code type:
Old name: New name:
WStringValueOrNull StringValueOrNull
WStringValue StringValue
StringValueOrNull BStringValueOrNull
StringValue BStringValue
E.g., in modern Windows programming wchar_t is the default choice (at
least for me), and then it's just a hassle, and makes for unreadable
code, to have "W" and "w" prefixes all over the place, on every name.
I also added a file [acknowledgments.txt].
TESTING:
Could readers please try to sort a large vector and large list of e.g.
BStringValue versus std::string, and report the timings? I'm suspecting
that at least for vector of strings, unoptimized BStringValue will be
significantly faster than a typical heavily optimized by best experts
around std::string. But this is just a hunch... ;-)
Cheers, & hope this can be interesting[1],
- Alf
Notes:
[1] I'm considering adding support for "tied" string values (e.g. a
string value that is just a pointer from Windows' argument list, but
keeping a reference count updated for that list), and += concatenation,
the latter because there's so much O(n^2) string concatenation code
around, and although values are immutable, += can do the equivalent of s
= s + t, only much more efficient with O(t) amortized copying time. I'm
not sure yet whether these two features are mutually incompatible!