bash: Don't load user32.dll for every shell process
commit3e502facfa2cb6f4b32b144ce846f873775886c9
authorKirill Smelkov <kirr@landau.phys.spbu.ru>
Wed, 4 May 2011 16:19:53 +0000 (4 20:19 +0400)
committerKirill Smelkov <kirr@landau.phys.spbu.ru>
Wed, 4 May 2011 17:57:04 +0000 (4 21:57 +0400)
treeed6563b36f91feb11364b9693af82e7c44a09233
parent745aac3f8edf4e78d89be49412bb24fc45193207
bash: Don't load user32.dll for every shell process

I've discovered that like msys.dll, bash too pulls user32.dll in on every
startup, which slows things down considerably.

It turned out that user32 bits are used in only one place to teach readline how
to paste from Windows clipboard.

Since this stuff is only occasionally used in interactive shells, and not used
at all in non-interactive scripts, let's load user32.dll dynamicaly, only when
needed.

Together with previous patch for msys.dll, this gains significant speedup for
shell scripts:

        bash's
        configure --help >/dev/null

old:    ~2.35s
new: ~1.95s

i.e. 17% improvement.

Under wine the difference is much more dramatic, since loading user32.dll there
is slower:

old:    ~56s
new:    ~31a

i.e. 44% speedup.

Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
src/rt/patches/0012-bash-Don-t-load-user32.dll-for-every-shell-process.patch [new file with mode: 0644]