RFR: 8302191: Performance degradation for float/double modulo on Linux
David Holmes
dholmes at openjdk.org
Mon Feb 13 02:55:28 UTC 2023
On Fri, 10 Feb 2023 09:06:56 GMT, Jan Kratochvil <duke at openjdk.org> wrote:
> I have OCA already processed/approved. I am not Author but my Author request is being processed these days (sent to Rob McKenna).
> I did regression test x86_64 OpenJDK-8. I will leave other regression testing on GHA.
> The patch (and former GCC performance regression) affects only x86_64+i686.
Thanks for raising this issue, and making the contribution.
If I understand correctly a change in gcc 4.9 (over 8 years ago) meant that our use of the `fmod` C-library implementation was no longer being compiled in an "optimal" way, and the proposal here is to replace the use of `fmod` with x86 assembler that does use that optimal" way.
However such a change does not belong in the file that has been modified, which is nominally (though not completely) shared code. If there is to be an x86 specific implementation for this then it would be added to `src/hotspot/cpu/x86/sharedRuntime_x86*.cpp` and shared version adapted accordingly for other architectures.
But before we would go that way we first need to confirm that:
a) the assembly code is 100% equivalent to the `fmod` being replaced
b) that the performance gain warrants the additional maintenance overhead of using cpu specific code
To ascertain (b) it would be good to see the DivisionDemo reformulated as a [JMH](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwi_-qfWvpH9AhW9T2wGHWj5AzYQFnoECCIQAQ&url=https%3A%2F%2Fgithub.com%2Fopenjdk%2Fjmh&usg=AOvVaw2LM5nJq9rAJUQjgub5sUZV) benchmark.
Thank you.
-------------
PR: https://git.openjdk.org/jdk/pull/12508
More information about the hotspot-dev
mailing list