* [Bug symtab/27937] Performance regression of 8% due to assert in dwarf/read/attribute.h
2021-06-01 8:30 [Bug symtab/27937] New: Performance regression of 8% due to assert in dwarf/read/attribute.h vries at gcc dot gnu.org
@ 2021-06-01 8:30 ` vries at gcc dot gnu.org
2021-06-01 15:26 ` ssbssa at sourceware dot org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: vries at gcc dot gnu.org @ 2021-06-01 8:30 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=27937
Tom de Vries <vries at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tromey at sourceware dot org
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug symtab/27937] Performance regression of 8% due to assert in dwarf/read/attribute.h
2021-06-01 8:30 [Bug symtab/27937] New: Performance regression of 8% due to assert in dwarf/read/attribute.h vries at gcc dot gnu.org
2021-06-01 8:30 ` [Bug symtab/27937] " vries at gcc dot gnu.org
@ 2021-06-01 15:26 ` ssbssa at sourceware dot org
2021-06-01 16:36 ` simark at simark dot ca
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: ssbssa at sourceware dot org @ 2021-06-01 15:26 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=27937
Hannes Domani <ssbssa at sourceware dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ssbssa at sourceware dot org
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug symtab/27937] Performance regression of 8% due to assert in dwarf/read/attribute.h
2021-06-01 8:30 [Bug symtab/27937] New: Performance regression of 8% due to assert in dwarf/read/attribute.h vries at gcc dot gnu.org
2021-06-01 8:30 ` [Bug symtab/27937] " vries at gcc dot gnu.org
2021-06-01 15:26 ` ssbssa at sourceware dot org
@ 2021-06-01 16:36 ` simark at simark dot ca
2021-06-01 21:12 ` tromey at sourceware dot org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: simark at simark dot ca @ 2021-06-01 16:36 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=27937
Simon Marchi <simark at simark dot ca> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |simark at simark dot ca
--- Comment #1 from Simon Marchi <simark at simark dot ca> ---
I sometimes wonder if we should have a gdb_assert version that is only enabled
in development builds, that we could use in very hot paths like this one,
without affecting performance of production builds. On one hand, it's not good
because problems could go unnoticed in production builds. But if the
alternative is removing the assert because it is too costly, then having it
only in development builds is better than nothing.
Also, I was wondering if this would have any effect on your measurements:
diff --git a/gdbsupport/gdb_assert.h b/gdbsupport/gdb_assert.h
index 00553a786135..74dcd653cc4e 100644
--- a/gdbsupport/gdb_assert.h
+++ b/gdbsupport/gdb_assert.h
@@ -32,7 +32,7 @@
replacing. */
#define gdb_assert(expr)
\
- ((void) ((expr) ? 0 :
\
+ ((void) (__builtin_expect ((expr), 0) ? 0 :
\
(gdb_assert_fail (#expr, __FILE__, __LINE__, FUNCTION_NAME), 0)))
/* This prints an "Assertion failed" message, asking the user if they
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug symtab/27937] Performance regression of 8% due to assert in dwarf/read/attribute.h
2021-06-01 8:30 [Bug symtab/27937] New: Performance regression of 8% due to assert in dwarf/read/attribute.h vries at gcc dot gnu.org
` (2 preceding siblings ...)
2021-06-01 16:36 ` simark at simark dot ca
@ 2021-06-01 21:12 ` tromey at sourceware dot org
2021-06-04 15:28 ` tromey at sourceware dot org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: tromey at sourceware dot org @ 2021-06-01 21:12 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=27937
--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
(In reply to Simon Marchi from comment #1)
> I sometimes wonder if we should have a gdb_assert version that is only
> enabled in development builds, that we could use in very hot paths like this
> one, without affecting performance of production builds.
Seems reasonable to me, and especially for this assert, which just introduces
a new check that didn't even exist in earlier versions. That is, removing
the assert or having it not run in production is identical to the status quo
ante.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug symtab/27937] Performance regression of 8% due to assert in dwarf/read/attribute.h
2021-06-01 8:30 [Bug symtab/27937] New: Performance regression of 8% due to assert in dwarf/read/attribute.h vries at gcc dot gnu.org
` (3 preceding siblings ...)
2021-06-01 21:12 ` tromey at sourceware dot org
@ 2021-06-04 15:28 ` tromey at sourceware dot org
2022-04-15 13:31 ` tromey at sourceware dot org
2022-04-15 13:58 ` tromey at sourceware dot org
6 siblings, 0 replies; 8+ messages in thread
From: tromey at sourceware dot org @ 2021-06-04 15:28 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=27937
--- Comment #3 from Tom Tromey <tromey at sourceware dot org> ---
(In reply to Tom Tromey from comment #2)
> (In reply to Simon Marchi from comment #1)
> > I sometimes wonder if we should have a gdb_assert version that is only
> > enabled in development builds, that we could use in very hot paths like this
> > one, without affecting performance of production builds.
>
> Seems reasonable to me, and especially for this assert, which just introduces
> a new check that didn't even exist in earlier versions. That is, removing
> the assert or having it not run in production is identical to the status quo
> ante.
After writing this, I remembered that Pedro hadn't like the
"asan-by-default" approach, because it meant that you had to
do a special build to do performance testing.
So maybe we need to have opt-in development asserts.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug symtab/27937] Performance regression of 8% due to assert in dwarf/read/attribute.h
2021-06-01 8:30 [Bug symtab/27937] New: Performance regression of 8% due to assert in dwarf/read/attribute.h vries at gcc dot gnu.org
` (4 preceding siblings ...)
2021-06-04 15:28 ` tromey at sourceware dot org
@ 2022-04-15 13:31 ` tromey at sourceware dot org
2022-04-15 13:58 ` tromey at sourceware dot org
6 siblings, 0 replies; 8+ messages in thread
From: tromey at sourceware dot org @ 2022-04-15 13:31 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=27937
--- Comment #4 from Tom Tromey <tromey at sourceware dot org> ---
I'm trying a debug assert that checks _GLIBCXX_DEBUG
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug symtab/27937] Performance regression of 8% due to assert in dwarf/read/attribute.h
2021-06-01 8:30 [Bug symtab/27937] New: Performance regression of 8% due to assert in dwarf/read/attribute.h vries at gcc dot gnu.org
` (5 preceding siblings ...)
2022-04-15 13:31 ` tromey at sourceware dot org
@ 2022-04-15 13:58 ` tromey at sourceware dot org
6 siblings, 0 replies; 8+ messages in thread
From: tromey at sourceware dot org @ 2022-04-15 13:58 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=27937
--- Comment #5 from Tom Tromey <tromey at sourceware dot org> ---
A simple test like:
/bin/time -f%e ~/gdb/install/bin/gdb -batch -nx -ex 'break internal_error'
/tmp/gdb
... does not show any improvement with this assert commented out.
So I wonder if it's still worthwhile.
Commenting out all the asserts in attribute.h does increase
that test's speed a little bit -- from ~2.06 to ~2.03 with a hot cache.
https://github.com/tromey/gdb/commit/b3ed9b13eb970972b72842644a894d95b02b71b0
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 8+ messages in thread