[PATCH] Speeding up kdebug

Nicolas Goutte nicolasg at snafu.de
Tue Oct 14 19:48:13 BST 2003


The attached path is for kdelibs/kdecore/kdebug.cpp, the attached file is for 
kdelibs/kdecore.

The idea is to speed up kdebug by parsing not at runtime but at compile time. 
(On my computer, getDescrFromNum needs 1 or 2 ms instead of 19 or 20 ms. It 
can change depending system and compiler optimization or because of slow or 
busy disks.) 

Some people will argue that we are using memory, but the current state makes 
that the OS needs to buffer the file, so we are not using more memory.

Some people will argue that they cannot change the debug areas easily. Well 
instead of copying, you need to compile, sure. But it does not take that 
long. (And changing the debug areas without having the source code is 
propably a corner case.)

The current state of the file kdebug_areas.h is provisory (as it is from KDE 
3.1.4.) If people find the patch right, I am going to make a better looking 
include file and also change Makefile.am (the include file is supposed to be 
private.)

(The idea of such a change is in KWord's RTF import filter: 
koffice/filters/kword/rtf/import/rtfimport.cpp .)

Have a nice day!

PS. only tested on KDE 3.1.4.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch_kdebug.diff
Type: text/x-diff
Size: 1994 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20031014/99ebe961/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdebug_areas.h
Type: text/x-chdr
Size: 8348 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20031014/99ebe961/attachment.h>


More information about the kde-core-devel mailing list