[PATCH] KURL optimizations

Maks Orlovich kde-optimize@mail.kde.org
Thu, 9 Jan 2003 23:34:59 -0500


> Why is its argument (and result) const anyway?
> All uses creates the QString before call.
> I am not sure that this part is worth it...
> Instead try to avoid all uses of QChar pointers.

Hmm?? QChar pointers are essentially pointers to ushorts. The only worrisome 
part here is that QChar::lower() can't be inlined. 

> (or rather if the .lower is so expensive shouldn't you avoid
> .unicode too? 

.unicode() inlines to { return d->unicode; } i.e. it's essentially free.
.lower() allocates a new QString on the heap, which requries 2 memory 
allocation calls - one of the heap, one for the data. Expensive in hot 
paths..