https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91257
Rogério de Souza Moraes <rogerio.souza at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rogerio.souza at gmail dot com
--- Comment #12 from Rogério de Souza Moraes <rogerio.souza at gmail dot com>
---
Hi Richard,
first, thank you for the great work improving the GCC performance.
The R&D team which I am working with provided two test cases, they show that it
was possible to reduce the build time by taking out the block containing
setjmp/longjmp to a separate routine, which is only called from the original
routine.
Both attached files, example_base.c and example_routines.c, are generated in a
very similar way, but in example_routines.c, all the 'try' macros are taken out
to separate routines.
The compilation times:
example_base.c:
v4.8.3 - 0m1.096s
v6.3.0 - 0m16.017s
v9.3.0 - 0m26.829s
example_routines.c
v4.8.3 - 0m0.955s
v6.3.0 - 0m1.205s
v9.3.0 - 0m1.617s
Is this approach ok to improve the build performance?
Even if this approach is OK, there are still details unclear to us, and some
might be not even known:
- Should we worry about inlining? Can we hint this to compiles, or should we
make sure it's avoided (by using routine pointers, for example)?
- Can we assume that routine call (with all low-level work like copying data on
the stack etc.) is the only runtime performance price for this approach?
- Is having many small routines instead of a few very large is universally
good, or there are cases when it by itself can cause a problem?
We appreciate very much any feedback.
Best regards,
--
Rogerio