"MacArthur, Ian (SELEX GALILEO, UK)" wrote:
> Michael Baeuerle wrote:
> > 
> > FLTK runs an order of magnitude slower if I change my locale from
> > ISO8859-1 to UTF-8. This is most annoying in the Fl_Menu_Bar widget.
> 
> Hmm, that's odd - I haven't noticed that myself.
> 
> If I get a chance, I'll try and take a look (though don't hold your breath 
> waiting...)
> 
> What WM are you running, and what IM system does your distro use?

The WM I have used is:
----------------------------------------------------------------------
$ fvwm -V
fvwm 2.5.31 compiled on Sep 27 2011 at 17:15:05
----------------------------------------------------------------------

Unfortunately I don't know how XIM works in detail, but my X server
seems to support it. The X server logfile list "XInputExtension" as
available:
----------------------------------------------------------------------
$ grep XInputExtension /var/log/Xorg.0.log
(II) Initializing built-in extension XInputExtension
----------------------------------------------------------------------
If I understand the description in [1] correctly, the IM that should be
used is selected via XOpenIM() by the client. And this function is
called from FLTK, from fl_init_xim() and fl_handle() in src/Fl_x.cxx to
name it.

> I don't have *any* BSD systems these days (well, Darwin/OSX aside I guess), 
> and I haven't noticed any sluggishness under Linux...

I have read somewhere that there may be X internal caching involved,
maybe your system do it and mine do not. It would not surprise me if
things are highly Linux-optimized there. Today most of the development
is done on and for GNU/Linux and the rest have to ... in germany we say
"friss oder stirb" (literally translated "eat or die"). But I hope that
is not the FLTK policy ;-)

It seems to me that XOpenIM() can be anything from really fast to really
slow. Therefore the interesting question is: Is it really necessary for
fltk to call XOpenIM() again every time the mouse pointer hits a new
entry on the menu bar (or a popup window is opened)?

> I suppose I might be able to set up a VM with BSD in it to see what 
> happens... Though my home phone line is broken (storms / telegraph poles...) 
> so I have no broadband at home right now, it'll likely be a while...

It would be interesting if your Linux box is simply that much faster but
do the same things, or do things in a different way. If I do the test as
explained in my OP, I can see how the locale files are opened and closed
for every entry while I move the mouse pointer over the menubar (with
opened pulldowns):
----------------------------------------------------------------------
$ ktruss ./x | grep -E "open|close"
 320  1 x  open("/usr/pkg/share/X11/locale/compose.dir", 0, 0x1b6) = 5
 320  1 x  close(0x5)                  = 0
 320  1 x  open("/usr/pkg/share/X11/locale/en_US.UTF-8/Compose",
              0, 0x1b6) = 5
 320  1 x  close(0x5)                  = 0
 320  1 x  open("/usr/pkg/share/X11/locale/compose.dir", 0, 0x1b6) = 5
 320  1 x  close(0x5)                  = 0
 320  1 x  open("/usr/pkg/share/X11/locale/en_US.UTF-8/Compose",
              0, 0x1b6) = 5
 320  1 x  close(0x5)                  = 0
[...]
----------------------------------------------------------------------
On Linux you should be able to get similar output using strace instead
of ktruss.

BTW: Thanks for looking at this.


[1] http://www.x.org/releases/X11R7.6/doc/libX11/specs/XIM/xim.html
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to