https://kotlinlang.org logo
Title
b

bjonnh

01/23/2021, 1:45 AM
how did you integrate with the JVM?
a

altavir

01/23/2021, 5:43 AM
No it is plain old JNI right now. Project Panama looks promising for simplifying FFI layer.
р

Ролан

01/23/2021, 8:35 AM
Hi @bjonnh, the JVM sees only the pointer to the tensor. Memory is managed through scoping mimicking what happens in native.
j

jimn

01/23/2021, 9:03 PM
not that this is on the wrong track but 100000 calls on a method will barely begin to trigger the hotspot. you are basically measuring the client JVM plus the overhead of the C2 compiler which might just be getting warmed up, right? if the oracle graalvm can be used or at least the JVMCI options, or if you want to roll through millions of iterations before sampling, that is how most jvm benchmarks measure the potential.
it looks like JVMCI in the oracle graal v19 can drop 25% off of one of my single threaded unit tests, suspect is that whatever ir compilation that happens will unbox lambdas that have Array<T> parameters, boxing being the single largest profile-able expense outside of page faulting.
even with the JMVCI static eval present the iteration throughput climbs for about 10 minutes of 3-5 hours unit test
a

altavir

01/24/2021, 5:02 AM
Those are JMH tests. Please read about JMH and benchmarking in jvm.
j

jimn

01/24/2021, 12:31 PM
does jmh somehow guarantee static analysis and warmup iterations?
a

altavir

01/24/2021, 12:37 PM
Please do read about it. There are tons of articles about benchmarking in java. JMH does not guarantee correct results for complicated applications, but we are talking about micro-benchmarks, and it is the only way to do proper micro-benchmarks.
😴 1
j

jimn

01/24/2021, 4:58 PM
a simple question about the warmup could be answered by numerical count of iterations. soliloquies about methodology really don't apply to a JVM benchmark showing 100k iterations.