Parsing of 'Compose' files is so slow!
Submitted by Benoît Minisini
Assigned to Xorg Project Team
Description
When profiling the start-up of my GUI program (the Gambas development environment, based on Qt4 and the Gambas interpreter), I noticed that almost 10% of the start-up time is spent inside a libX11.so function named "_XimParseString". As much time as what is spent by the interpreter itself!
This function is located in the modules/im/ximcp/imLcPrs.c XLib source file.
Half on that time is spent in the nextch() static function of the same source file, because getc() is used for reading each character of the "Compose" file, which is usually half a megabyte.
getc() is very slow. Implementing a buffer without using the libc would speed up things a lot.
I will try to rewrite the file and recompile the libX11 on my system. If I don't succeed, is there any X11 developer or tester there that could test the file for me?
Thanks in advance.
Version: 7.7 (2012.06)