[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: KDE/kdevplatform/language/duchain/builders
From:       Milian Wolff <mail () milianw ! de>
Date:       2009-07-22 17:09:37
Message-ID: 4A6747D1.8060102 () milianw ! de
[Download RAW message or body]

David Nolden wrote:
> Am Mittwoch 22 Juli 2009 18:20:04 schrieb Milian Wolff:
>> Oh man... now we have to change all the stuff in PHP?! It worked before,
>> didn't it... Esp. with my commits which fixed Cpp... What is the
>> advantage of storing it as QByteArray instead of QString?
> 
> The problem is that:
> A) The parser uses utf8
> B) The duchain uses utf8 to store it (See 
> KDevelop::Declaration::setComment(QByteArray)).
> 
> And thus it's just wrong converting it to a QString intermediately, as that is 
> slow. At least for C++ that does matter, because I remember I've seen it on 
> the profiling results.
> 
> I don't think you'll have to change much in php support, as 
> Declaration::setComment already takes a byte-array anyway. If you don't want 
> to change everything to work with QByteArray directly internally, you can add 
> an overloaded "PhpDeclarationBuilder::setComment(QString comment) { 
> setComment(comment.toUtf8()); }" and should be fine.
> 
> Greetings, David

We used our own helper function which I could use to make the switch as 
painless as possible.

But your comment regarding performance is interesting: Should our parser 
also switch to use QByteArray instead of QString? Currently we store the 
file contents in a QString in our parse session.

Maybe I should profile that...

-- 
Milian Wolff
http://milianw.de
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic