public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/17687] New: linear search in cp_add_using_directive
@ 2014-12-07 22:29 xdje42 at gmail dot com
  2014-12-07 22:30 ` [Bug c++/17687] " xdje42 at gmail dot com
  0 siblings, 1 reply; 2+ messages in thread
From: xdje42 at gmail dot com @ 2014-12-07 22:29 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17687

            Bug ID: 17687
           Summary: linear search in cp_add_using_directive
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: c++
          Assignee: unassigned at sourceware dot org
          Reporter: xdje42 at gmail dot com

Filing this to remember a potential perf issue.

I noticed this while debugging another issue.
I had set a breakpoint on cp_add_using_directive and saw it being called once
for each symbol thusly:

(top-gdb) c
Continuing.

Breakpoint 3, cp_add_using_directive (dest=0x7ffff0659462 "std",
    src=0x866f92 "", alias=0x0, declaration=0x7ffff05f5eb1 "clearerr",
    excludes=0x0, copy_names=0, obstack=0x16285f0)
    at ../../anon-ns-16874/gdb/cp-namespace.c:139
(top-gdb) 
Continuing.

Breakpoint 3, cp_add_using_directive (dest=0x7ffff0659462 "std",
    src=0x866f92 "", alias=0x0, declaration=0x7ffff05f71ce "fclose",
    excludes=0x0, copy_names=0, obstack=0x16285f0)
    at ../../anon-ns-16874/gdb/cp-namespace.c:139
(top-gdb) 
Continuing.

Breakpoint 3, cp_add_using_directive (dest=0x7ffff0659462 "std",
    src=0x866f92 "", alias=0x0, declaration=0x7ffff05f97dd "feof",
    excludes=0x0, copy_names=0, obstack=0x16285f0)
    at ../../anon-ns-16874/gdb/cp-namespace.c:139
(top-gdb) 
Continuing.

Breakpoint 3, cp_add_using_directive (dest=0x7ffff0659462 "std",
    src=0x866f92 "", alias=0x0, declaration=0x7ffff05f8356 "ferror",
    excludes=0x0, copy_names=0, obstack=0x16285f0)
    at ../../anon-ns-16874/gdb/cp-namespace.c:139
(top-gdb) 
Continuing.

Breakpoint 3, cp_add_using_directive (dest=0x7ffff0659462 "std",
    src=0x866f92 "", alias=0x0, declaration=0x7ffff05fb494 "fflush",
    excludes=0x0, copy_names=0, obstack=0x16285f0)
    at ../../anon-ns-16874/gdb/cp-namespace.c:139
(top-gdb) 

Is this a potential perf issue?
[both when reading debug info and later when doing lookups]


(top-gdb) bt
#0  cp_add_using_directive (dest=0x7ffff0659462 "std", src=0x866f92 "",
    alias=0x0, declaration=0x7ffff06562d6 "mbstate_t", excludes=0x0,
    copy_names=0, obstack=0x16285f0)
    at ../../anon-ns-16874/gdb/cp-namespace.c:139
#1  0x000000000062e254 in read_import_statement (die=0x1798f70, cu=0x16af3e0)
    at ../../anon-ns-16874/gdb/dwarf2read.c:8896
#2  0x000000000062ce73 in process_die (die=0x1798f70, cu=0x16af3e0)
    at ../../anon-ns-16874/gdb/dwarf2read.c:8234
#3  0x000000000063b3e0 in read_namespace (die=0x1798e30, cu=0x16af3e0)
    at ../../anon-ns-16874/gdb/dwarf2read.c:13898
#4  0x000000000062cd92 in process_die (die=0x1798e30, cu=0x16af3e0)
    at ../../anon-ns-16874/gdb/dwarf2read.c:8217
#5  0x000000000062e78b in read_file_scope (die=0x17d0290, cu=0x16af3e0)
    at ../../anon-ns-16874/gdb/dwarf2read.c:9057
#6  0x000000000062cc90 in process_die (die=0x17d0290, cu=0x16af3e0)
    at ../../anon-ns-16874/gdb/dwarf2read.c:8164
#7  0x000000000062c53e in process_full_comp_unit (per_cu=0x1627f40,
    pretend_language=language_minimal)
    at ../../anon-ns-16874/gdb/dwarf2read.c:7946
#8  0x000000000062b4ee in process_queue ()
    at ../../anon-ns-16874/gdb/dwarf2read.c:7484
#9  0x00000000006207cc in dw2_do_instantiate_symtab (per_cu=0x1627f40)
    at ../../anon-ns-16874/gdb/dwarf2read.c:2638
#10 0x000000000062085e in dw2_instantiate_symtab (per_cu=0x1627f40)
    at ../../anon-ns-16874/gdb/dwarf2read.c:2659
#11 0x0000000000622f9a in dw2_lookup_symbol (objfile=0x1628590, block_index=0,
name=0x1490640 "(anonymous namespace)",
    domain=VAR_DOMAIN) at ../../anon-ns-16874/gdb/dwarf2read.c:3612
#12 0x000000000059ac9c in lookup_symbol_via_quick_fns (
    objfile=objfile@entry=0x1628590, block_index=block_index@entry=0,
    name=name@entry=0x1490640 "(anonymous namespace)",
    domain=domain@entry=VAR_DOMAIN) at ../../anon-ns-16874/gdb/symtab.c:1679
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/17687] linear search in cp_add_using_directive
  2014-12-07 22:29 [Bug c++/17687] New: linear search in cp_add_using_directive xdje42 at gmail dot com
@ 2014-12-07 22:30 ` xdje42 at gmail dot com
  0 siblings, 0 replies; 2+ messages in thread
From: xdje42 at gmail dot com @ 2014-12-07 22:30 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17687

Doug Evans <xdje42 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |performance

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-12-07 22:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-07 22:29 [Bug c++/17687] New: linear search in cp_add_using_directive xdje42 at gmail dot com
2014-12-07 22:30 ` [Bug c++/17687] " xdje42 at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).