On Mon, 27 Feb 2023 11:49:27 GMT, Jayathirth D V <j...@openjdk.org> wrote:

> Under https://bugs.openjdk.org/browse/JDK-8264846 we moved to -O3 level of 
> gcc optimizations from -O1 level for libawt build. This improved our J2DBench 
> performance numbers in some options considerably.
> 
> Recent changes done under https://bugs.openjdk.org/browse/JDK-8299337 causes 
> difference in generated code by gcc and this is resulting in performance 
> regression for bimg_misc-* J2DBench options in our performance servers. Under 
> https://bugs.openjdk.org/browse/JDK-8299337 we have just removed unused 
> variables and it is a cleanup task.
> 
> We can force gcc to generate position independent code by using -fpic 
> option.Also i have removed -fgcse-after-reload option for gcc, because this 
> is by default covered under -O3 level of optimization introduced under 
> https://bugs.openjdk.org/browse/JDK-8264846.
> 
> With this change bimg_misc-* J2DBench option performance regression is 
> resolved and there are no regression in other options of J2DBench or 
> SwingMark and it is verified in our performance servers.

make/modules/java.desktop/lib/Awt2dLibraries.gmk line 132:

> 130:   # that any cleanup of code related to AWT will not change the
> 131:   # generated code and cause performance issues in J2DBench
> 132:   LIBAWT_CFLAGS += -fpic

We compile with `-fPIC` as a standard flag for position independent code (I 
just verified that LIBAWT also gets this flag today). My understanding is that 
`-fpic` may result in smaller/faster code. Overriding with `-fpic` seems like 
its helping here, but the comment needs to be fixed to explain the actual 
difference and reason.

-------------

PR: https://git.openjdk.org/jdk/pull/12761

Reply via email to