RFR: 8334495: Use FFM instead of jdk.internal.misc.Unsafe in java.desktop font implementation [v2]

Phil Race prr at openjdk.org
Wed Jul 17 21:30:37 UTC 2024


On Thu, 11 Jul 2024 00:24:41 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

> > or if the layout code is executed first then I'd expect to see zero machinery init cost here.
> 
> It will be good to check thi.s So we'll use it freely, assuming it won't introduce any additional overhead.

StrikeCache will always be initialised before you can execute the FFM-based harfbuzz code.
So all I can measure is how much faster does the FFM HB get (first time) as a result of the pre-initialisation of FFM.

So I have 2 JDK builds, one with both changes, the other with just the pre-existing harfbuzz changes.
In both I instrumented around the SunLayoutEngine.java code that initialises HBShaper.java
to record the time to execute the first call to layout.

In the case where ONLY the FFM harfbuzz changes are in it is around 178ms (best result of 10)
In the case where BOTH FFM changes are in it is around 123 ms (best result of 10)
There were quite a few of the runs in that ballpark
So it is around 55ms faster to run the hb code after already initialising the FFM-using StrikeCache.

NB those times (124ms and 178 ms ) include the execution time for layout as well,
but the difference is what matters to answer this question and it is answered as expected.

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

PR Comment: https://git.openjdk.org/jdk/pull/19777#issuecomment-2234342820


More information about the client-libs-dev mailing list