https://kotlinlang.org logo
Title
n

napperley

06/22/2018, 11:52 PM
Looking for Kotliners who are interested in contributing to the OpenFaaS Kotlin Templates project ( https://github.com/napperley/openfaas-kotlin-templates ). The project provides Kotlin templates for the open source OpenFaas ( https://www.openfaas.com/ ) Serverless platform, which is supported by the community. Need some people who can work on a new OpenFaaS Kotlin JVM template, which will use Graal as the preferred JVM implementation.
g

gildor

06/24/2018, 10:38 AM
Are you talking about Graal for AOT or just as alternative VM?
k

kenkyee

06/24/2018, 4:02 PM
What contributions do you need?
n

napperley

06/24/2018, 9:14 PM
Graal is used as alternative VM.
After contributions to a new Kotlin JVM template (that will work in a manner similar to the Kotlin Native template), using a lightweight library/framework/toolkit which is suitable for Serverless.
g

gildor

06/25/2018, 1:11 AM
What is a point to use Graal as VM in your case?
n

napperley

06/25/2018, 1:47 AM
Shorter startup time, smaller code size, and lower memory usage.
g

gildor

06/25/2018, 1:56 AM
Do you have any good benchmarks about this?
n

napperley

06/25/2018, 4:28 AM
There is this Graal benchmark (covers Netty) which is relevant for Serverless: https://medium.com/graalvm/instant-netty-startup-using-graalvm-native-image-generation-ed6f14ff7692 . Main catch with the benchmarks is that they only cover the native image side instead of the VM side.
g

gildor

06/25/2018, 4:53 AM
Exactly
There are obvious advantages (and restrictions and disadvantages) of compilation to native binary But if we talk about alternative VM, I’m not sure that it’s so obvious, yeah, looks like Graal JVM probably can give some improvements for some specific use cases, but this is not so visible and also can be slower than newest JVMs (graal vm implementation is for Java 8 ) and of course has much less adoption, so not sure that this is really worth to do and adopt Graal VM for some generic project, at least now
n

napperley

06/25/2018, 8:43 AM
In that case it might be worth looking into OpenJ9 (https://www.eclipse.org/openj9/).
g

gildor

06/25/2018, 8:49 AM
I don’t think that openj9 is somehow significant better for generic use case. Looks more like marketing about “cost-effectively in the cloud”
sure, maybe for some highload use cases it make sense (but I’m not really believe, probably you can get more just from tuning JVM for your use case), but for functions I think it’s nothing comparing on startup penalty
k

kenkyee

06/25/2018, 12:49 PM
Ditto, I don't think Graal as a VM is worth it. Startup time is similar to other VMs. Graal AOT on the other hand is worth it for serverless...
👍 1
g

gildor

06/25/2018, 12:53 PM
@kenkyee +100
Actually for FaaS graal aot looks like an obvious choice. You just need some webserver that works with aot without too much configuration
n

napperley

06/25/2018, 9:20 PM
Very likely to be a huge issue since many Java/Kotlin libraries/frameworks/toolkits use Netty as a basic web server. Vert.x wouldn't be a possible option when you look at the sheer amount of changes that need to be made for Graal AOT: https://vertx.io/blog/eclipse-vert-x-goes-native/