Speeding up i18n

Olivier Goffart ogoffart at kde.org
Tue Feb 3 08:35:46 GMT 2009


Le mardi 3 février 2009, John Tapsell a écrit :
> Hi all,
>
>   Has anyone looked into speeding up i18n calls by generating the
> string hash at compile time rather than at runtime.   Presumably it
> could be done by a little bit of template magic in the i18n call.
>
>   It would be interesting to investigate its effect on compile times
> and application load times.

I already tried to do operations on strings at compile time but without 
success.
Using some template, and good optimisation flag, the compiler can optimize the 
hash computation of small strings, but once the string has a reasonable size, 
its not optimized.

My objective was to keep strings simple to type., ie.  STR("Some String")  and 
not
STR<'S', STR<'o', STR<'m', STR<'e' STR<' ', STR<'S', STR<'t', STR<'r', 
STR<'i', STR<'n', STR<'g'> > > > > > > > > > > >     

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20090203/f77e60bf/attachment.sig>


More information about the kde-core-devel mailing list