small string optimization?

Tim Jansen kde-optimize@mail.kde.org
Tue, 21 Jan 2003 18:50:02 +0100


On Tuesday 21 January 2003 03:22, Steve Hutton wrote:
> I haven't looked at the QString code to see if
> they are already doing this.  If not, perhaps
> the small string optimization recently adopted by
> many std::string implemenations might improve
> performance?
> http://tinyurl.com/4om6

QString uses 2-4 bytes for each character, so it is rather unlikely that it 
would help. If you would want to reduce the number of allocated memory blocks 
and are not scared of ugly tricks, you could try to allocate the char buffer 
and the QStringData object in the same memory block.

bye...