On Thu, 16 Nov 2023 19:56:51 GMT, Phil Race <p...@openjdk.org> wrote:

> > > > > > layoutCnt=16000 total=193ms <<< app fully displayed
> > > > > > vs
> > > > > > layoutCnt=16000 total=453ms <<< app fully displayed
> > > > > 
> > > > > 
> > > > > It looks strange that 16000 calls are not enough to warmup, and the 
> > > > > difference is so large.
> > > > 
> > > > 
> > > > I am not a C2 expert, (not even an amateur), I just assume that it 
> > > > takes a lot of calls to be fully optimized.
> > > 
> > > 
> > > @JornVernee this looks suspicious and seems unrelated to the cold startup 
> > > issues we discussed before.
> > 
> > 
> > I suspect the benchmark might be measuring the java.lang.foreign code 
> > needing to be loaded as part of the benchmark. While for JNI, the 
> > initialization of all the JNI machinery is included in the startup of the 
> > application. Was the running time of the entire application/process 
> > measured? Or only from the start of the `main` method?
> 
> Yes, that's correct, it includes all the startup costs in that number. So as 
> @jayathirthrao observed, the comment "16000 calls are not enough to warmup" 
> may be slightly off the mark since at this time, each 1,000 FFM calls is 
> already roughly as fast as each 1,000 JNI calls So we ARE warmed up by then, 
> but I have no idea what would be a normal expectation. Looking at the numbers 
> above it is roughly around 12,000 that we reach parity for the speed of each 
> incremental call.

C2/fully optimized compilation kicks in after 10 000 calls, and is asynchronous 
by default (i.e. the rest of the application keeps running). So, 12,000 sounds 
relatively normal to me.

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

PR Comment: https://git.openjdk.org/jdk/pull/15476#issuecomment-1815260564

Reply via email to