Bug 53540

Summary: Parsing of 'Compose' files is so slow!
Product: xorg Reporter: Benoît Minisini <benoit.minisini>
Component: Lib/XlibAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED MOVED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: jann+freedesktop_bugzilla
Version: 7.7 (2012.06)   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Benoît Minisini 2012-08-15 12:52:38 UTC
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.
Comment 1 GitLab Migration User 2018-08-10 20:10:12 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/lib/libx11/issues/20.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.