[graalvm-users] Graalvm performance

Chris Seaton chris.seaton at oracle.com
Tue May 15 02:48:49 PDT 2018



> On 15 May 2018, at 02:02, Rodrigo Botafogo <rodrigo.a.botafogo at gmail.com> wrote:
> 
> Hello graAll,
> 
> From  the documentation and videos about graal,  I understand that code in any language should be quite efficient when running under graal.  However, are there specific cases for which one language should perform better than the others?

If the languages had the same semantics, then yes, but real languages have varying semantics that we need to implement which can take more or less logic.

For example, in some languages you need to check for overflow when you do arithmetic, and in other languages you don’t. If nothing is known about the values at runtime, we won’t be able to remove those overflow checks and the language with the checks will be slower. So it still sometimes makes sense to use a lower-level language.

> For instance, suppose I want to implement matrix multiplication, doing this in a java matrix is expected to be as efficient as storing the data in a ruby array?

No, because of those Ruby overflow checks if you’re using integers. It might be able the same for matrix multiplication for doubles, but there might still be some additional checks that get in the way.

> Will the compiler identify that the data in the ruby array are doubles and manage to turn this in as efficient code as storing in a double java matrix?

Yes Ruby does this.

> Also, efficient matrix multiply algorithms read the matrix in special order to maximize the use of data in the registry.  Should the same be considered when using graal or will the compiler manage to do its magic by itself?

No, Graal doesn’t do anything to dynamically adapt the data structure to profiled read patterns, at the moment.

> 
> 
> Thanks
> 
> 
> -- 
> Rodrigo Botafogo
> 
> _______________________________________________
> GraalVM-Users mailing list
> GraalVM-Users at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/graalvm-users




More information about the GraalVM-Users mailing list