Bug 14619 - Slow startup when built without --disable-nls
Summary: Slow startup when built without --disable-nls
Status: WAITING
Alias: None
Product: gdb
Classification: Unclassified
Component: win32 (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-25 09:53 UTC by vanboxem.ruben
Modified: 2023-02-11 17:50 UTC (History)
3 users (show)

See Also:
Host:
Target: *-*-mingw*
Build:
Last reconfirmed:


Attachments
gprof profile data for GDB with and without nls (236.35 KB, application/zip)
2012-09-28 10:48 UTC, vanboxem.ruben
Details

Note You need to log in before you can comment on or make changes to this bug.
Description vanboxem.ruben 2012-09-25 09:53:28 UTC
On Windows, when starting a Qt GUI "Hello World!" style app, startup time on my 8GB RAM Core i5 2.5-3.2 GHz is dramatically increased when gdb is not built without nls. Doing

gdb testapp
set verbose on
run

shows me that the delay is due to symbol loading of QtCore4d (2 vs 6 seconds) and QtGui4d (6 vs 18 seconds). The times are counted by me and recorder visually. The issue is discussed here:
http://sourceforge.net/mailarchive/message.php?msg_id=29795741

Where the "rubenvb" build left out --disable-nls and the mingw-builds didn't. I built gdb with --disable-nls seperately and verified it improves the times as described above and in that thread.

I'm sure this isn't wanted. Providing a minimal testcase will be difficult, the Qt debug DLL's involved are quite large, but it should be reproducible with the official Qt installer and for example my GCC 4.7.1 32-bit toolchains' gdb.
Comment 1 asmwarrior 2012-09-26 00:53:03 UTC
Does this a 64bit gdb issue or 32bit gdb issue?
I read the post:
http://sourceforge.net/mailarchive/message.php?msg_id=29795741
They said they were using "mingw64-gcc-4.7.1-2-rubenvb and Mingw-builds-4.7.1 (both 64 bit native) in Qt Creator".
Comment 2 vanboxem.ruben 2012-09-27 08:34:54 UTC
(In reply to comment #1)
> Does this a 64bit gdb issue or 32bit gdb issue?
> I read the post:
> http://sourceforge.net/mailarchive/message.php?msg_id=29795741
> They said they were using "mingw64-gcc-4.7.1-2-rubenvb and Mingw-builds-4.7.1
> (both 64 bit native) in Qt Creator".

It is not specific to 64-bit. I just built and tested a 32-bit Qt with my 4.7.2 32-bit toolchain and slow gdb, and startup is about 16 seconds. Switching to a gdb configured with --disable-nls makes that startup time about 6 seconds.
Comment 3 Tom Tromey 2012-09-27 15:28:14 UTC
(In reply to comment #2)
>  Switching to a
> gdb configured with --disable-nls makes that startup time about 6 seconds.

I saw something similar to this once where a certain .exe was causing
gdb to emit millions of calls to complaint.
The simplest way to track it down is to do some profiling to see what
the problem really is.
That may give us some idea of what to do about it.
Comment 4 vanboxem.ruben 2012-09-28 10:48:29 UTC
Created attachment 6659 [details]
gprof profile data for GDB with and without nls

I attached profile data for gdb without --disable-nls (gdb.txt) and with --disable-nls (gdb-nls.txt). I have verified that under profiling the difference in time between the two versions is present.

I built expat/gdb like this:
$ ../expat-2.1.0/configure --host=x86_64-w64-mingw32 --prefix=/expat --disable-shared CFLAGS=-pg CXXFLAGS=-pg LDFLAGS=-pg && make && make install

$ ../gdb-7.5/configure --host=x86_64-w64-mingw32 --prefix=/gdb --disable-multilib --disable-win32-registry --disable-rpath --disable-werror AR=ar --with-libexpat-prefix=/expat --disable-nls CFLAGS=-pg CXXFLAGS=-pg LDFLAGS=-pg && make && make install

$ ../gdb-7.5/configure --host=x86_64-w64-mingw32 --prefix=/gdb-nls --disable-multilib --disable-win32-registry --disable-rpath --disable-werror AR=ar --with-libexpat-prefix=/expat CFLAGS=-pg CXXFLAGS=-pg LDFLAGS=-pg && make && make install

If you need anything else, I'll see what I can do.
Comment 5 Tom Tromey 2012-09-28 15:27:51 UTC
Something strange is going on, because the profile data
says that the two runs took nearly the same time.

From gdb-nls.txt:

granularity: each sample hit covers 4 byte(s) for 0.08% of 11.99 seconds

From gdb.txt:

granularity: each sample hit covers 4 byte(s) for 0.09% of 11.70 seconds
Comment 6 Tom Tromey 2023-02-11 17:50:33 UTC
We discovered with the new DWARF indexer that strcasecmp is
extremely slow on mingw.  The new indexer has its own version
that is much faster.  So, I wonder if that has fixed this problem?
It's in GDB 13.