GraalVM: Run Programs Faster Everywhere

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone can you hear me yeah I see that I can how are you doing I know that it's been a long day so I try to keep my presentation short and practical so that you will not like fall asleep my name is Alena I'm the world for decade or growl VM at Oracle labs and I'm happy that this year Oracle code came to Rome so that we can all meet talk to each other and actually learn something from each other so let's talk about bravo vm ya safe harbor statement please don't do many any purchasing decisions based at the content of this presentation even if you like it very much let's talk about growl vm just a quick thing how many of you have heard about brawl the end before okay a few people and how many have tried using it oh I see that you're in there okay okay so for those of you who haven't heard about growl the end before it's a new kind of virtual machine and it has these new capabilities so it is efficient it's optimized to be efficient for a wide set of mountain of languages it is also multilingual meaning that it support not only one and not an arrow but rather a wide set of languages and we will name the light later in the presentation it is unbearable meaning that you can use it in Verizon vironment and kind of enrich the environment you are working in with grovelling abilities and also it is secure which is something that we all care about so why did it all start right so gray VM itself was created an Oracle labs and or colas is this research organization at Oracle so what our team is working on is trying to identify research and implement new technologies that hopefully will be needed in the future profits VM itself started as this research project - and our team has this mission to solve some of the very common programming world challenges because as advanced as the current programming world is there are still very common challenges like for example not all of even popular programming languages have high performance implementation because usually it requires cuts kind of industry level backup for programming language to be really performant and not all the languages have that also typical common virtual machines usually support only one language or a very narrow set of dos meaning that all those teams working on the languages implementation need to work on the same things like virtual machine garbage collection compiler this kind of things and perhaps those efforts could be unified if you could support more languages so it with all that in mind our team started working on the grow of VM project and seven years after that right now and more than 60 papers academic papers after that we are happy to share with you what girl vm is and what it can do for you so let's go deeper into what it can do for you so first of all it can take your existing applications written for example in Java Scala quatl in whatever you name it and run them faster so you can think of it as of drop-in replacement because you don't need to adapt your application to be compatible with grow a VM you just take them as they are you put them on royal VM and you have this possibility of running them faster second thing is instant startup and low footprint this is possible with other native images technology which is enabling you to take your Java JVM application and pack it into really small native binary meaning that it will be fully functional and you can run it somewhere on a machine in the zona server which has non JVM installed and it will be a fully working fully functional by itself without external dependencies also it is polyglot an embeddable meaning that it can enrich your existent workload with new capabilities and it can offer you really smooth interval between different languages so you can say that Interop itself is not really a new concept and I agree with you but what we can offer here is making this Interop really smooth and really performant meaning that you don't need to care any more about things like cyril ization visualization performance penalties while crossing languages borders you can get this really high performance interrupt the box as it is so let's take a closer look like how it works and what it can give you so looking at this chart you can see that on top here we have programming languages and below we have platforms where you can use broad a.m. so you can think of it as if it kind of sits in between languages and platforms and provides interlope tooling and optimization for the whole thing for your whole application and environment if you pay attention to the language is here you can see that there are Java jvm languages so yeah we have this capability to run your existing JVM application as as they are in the context of open JDK and I think it is important thing to kinda remember that we have like a full scale full volume GBM in Brawl VM so your traditional Java setup where you would run JVM application but be fully included in raw VM when you get it and when you run it surrounding your application as they are totally can do it also we support languages like Java or JavaScript Ruby are and Python so we can run all of them on growl vm and get a better performance in many cases interesting thing here as you can see C++ there is that we can also run native languages like C C++ basically anything that can compile down to LLVM bit code you can run on relevee m2 and talking about platforms you mentioned open JDK also we can run on GS applications and interesting thing is that you can use Bravo VM with Oracle database or my SiC well and what you can do in there is that you can kind of use your business logic straight in your database for example perform some validation and you don't need to like query your data first and process those somewhere else you can do all of that right in your database and the last but not least mode here is a standalone mode where all VM is what I mentioned before can pack your application in a native image that would be fully working and will not need any external dependencies and it will start really fast we will see examples later on in the presentation so how is it possible and what is under the hood because I think you will be curious have is that achievable and what's in there and how all of the parts are working together so as a base here we have high score VM which is your regular Java Virtual Machine as I mentioned became around job applications just they are on top of there you can see girl compiler which is our new compiler and you can see that it's kind of plugged into a hot spot VM so this was possible to do since Java nine when GBMC I was introduced so GBMC i is the java virtual machine compiler interface and it's a thing that enables you to plug in external compiler and kind of compare of your particular workload whatever compiler works better for you and bytes and that make a decision what compiler to use on top here we can see truffle truffle is our language implementation API so it's true truffle we can add more and more languages on gravy and platform and they will be working together and we'll get high performance and Excise to the whole ecosystem to the whole set of tools because they all implemented using this one implementation API so check in just a closer look at the echo system you can see all of the languages that we support so Java jvm languages we support directly through a hotspot VM growl compiler kind of bones and additional languages we adds through the truffle implementation API and a new thing coming here is salon so salon is our LLVM a bit code interpreter that's the way how we can run native languages in growl vm and yeah run all of those languages together how to get started so as a starting point if you want to check rolla vm i recommend you go into grove vm dot org this is our website and there you can go like in different directions you can go to try to downloads and try grow a vm as a like drop-in replacement for your pet for your current workload you can read documentation we have about the commanded cases for different scenarios or you can read the manual how to get started also another veggie goal would be checking our github repository it's like here in the top but I think you cannot see it on this screenshot so we have open-source version which is available on github and you can take a closer look at it and see how the teen's works from the inside and if you want to support us we would be super happy because of that let's go buy each component and I will show you the most along the way how they all work and what they can give to you so gravity arm compiler is a new compiler what is interested in it is that it is written from scratch so it is a new modern compiler it's also written in Java so if you work with Java everyday you will be able to understand really well how it works you can check our code and understand how that ends up working and playing together it integrates with the hotspot VM in the way that we've seen before it's modular easily maintainable and another interesting thing is that it's really optimized to for a wide set of languages so we can support all of those languages in this one compiler thing so this is the way it interacts with hotspot VM as I mentioned through GV mci and what is interesting here is that for example if you have tried like digging really deep into hotspot vm trying to understand how it works perhaps it would take you quite some time and commitment to understand that because you would require some knowledge of native languages and also because hotspot vm itself is such an advanced thing capable of doing so many scenarios that it would be hard and take quite some time to understand how it works unless you already are a compiler engineer or a researcher in the field with dragon power you can understand at least that particular part fairly quickly and easy because it's written in Java and it's available for you and it's external so you can understand how it works and how it will work with your particular code so I've said nice many nice things about growth VM performance let's take a closer look how it works and I hope you appreciate my graphic design efforts here any of old games fans in here except me oh so many people unhappy so I will show you a demo particularly dedicated to the grow of compiler performance capabilities let me go through it okay so I have a demo prepared for you and it's over here and I will show you what it does in the seconds so I will run a benchmark and I will run it in two setups one of them will include a growl compiler and another well not so we will have the same VM just with running with two different compilers and we will see the difference at the actual compiler brings to the performance of our application so normally I would go like Java jar and then give it the actual benchmark file but for the very first time I want to run it in like default setup without Braille compiler and the second time will be this compiler so we will see the performance it brings so to disable compiler because I'm currently using crawl VM I will disable using GBMC I yeah and the benchmark started running and I will show you what it does so it's a fairly simple benchmark we are getting a bunch of ins over here we are performing some students operation of them and we reduce them here in the end so that's what the actual program does and regarding the side up of the benchmark we run one iteration of warm-up to give it like a chance to warm up and then we run three iteration of the actual benchmark measurements and the unit of measurement is not a second spore operation meaning that lower numbers are better because they mean that we are running operations faster so for the first time we have the results ready and they are 172 nano preparation so that it was like the default Java setup let's run it with rel compiler knob and see what the difference it brings and I want to do something while it is working let's do some Bolton how do you think the growl compiler set up would it be faster would be slower we think it would be faster not a very optimistic audience I would say okay we think it would be like 5% faster I saw a hand over there okay okay let's make it even more competitive I have a small gift for a person who will name the closest number to how fast it's going to be you can just shut out with like how many percent of how many times would be faster and I have something special for you so let's let's vote 14 oh that's the kind of attitude I was looking for once again 25 you like very few people optimistic but those who are really really optimistic about girl compiler I like it any more bets once again sorry okay okay any more numbers let's see the actual result so the score this time is nine point seven who remembers what was the first time yeah so yeah here are our results for the first time which means it is 17 X speed-up which version was who facade the closest number to that sorry I just done here then see you because of the lightning forty is by DiMaggio I think it was 25 right for year 14 of 14 14 now I think 2005 yeah was the closest to come to me afterwards I heard something for you it's actually it's my favorite chocolate I know it may be like not the best idea to compete with Italian food here I know it's like a losing game but I tell me if you like it afterwards so let's proceed to the presentation okay and one more notes regarding the benchmark thing is that this kind of result will really depend on your particular workload on your machine on your actual working environment so before going straight into using closed VM you want to evaluate it on your workload but yes performance boost like this is really available for certain workloads and it is the best part is that it's like drop-in replacement meaning the dot you don't need to do much effort to make your application compatible with grow vm you just take it Iran and on top of it you get performance boost that is something I think is worth checking it for you a few words about compiler optimizations what are those how they happen in what is actually this performance boost coming from so things like inline in I assume you may be familiar with growl VM popular has its own approach on inline and algorithms which are more aggressive and produce more efficient code another thing that I want to mention here is partial escape analysis so while we analyze this kind of escape ability of objects we do it for each particular branch meaning that we are more aggressive in those optimizations rather than analyzing the global it capability of the object so we can this way we can remove many object allocations meaning that we will give you your application this improved performance and yeah thanks to those it is also applicable to run a lot of running applications another thing another huge component of your VM that I want to touch here is language implementation API so through this language implementation API the implement language is some of the languages you've seen before like JavaScript Python and others since we use one language implementation API for all of those languages this rule it really enables this interval between languages to be really efficient and for you to be able to access things from different languages between each other without paying performance penalties and it also makes it for us slightly easier and faster add in new languages to the platform because of this one approach that we have to remind you where it sits in the system and why it is needed it's over here so all those languages on top of transfer languages are implemented without the language implementation API and interesting thing is that you can also implement your own language like for example if you have created a language or you are using some custom language at your work in your project you can run it on growl VM what you need to do is just write an interpreter for the language and I will also mention one example of people who already have tried doing this later in the presentation polyglot programs one of the things that we often hear about growl VM is that it's capable of running polyglot programs meaning that you can write write application in using different languages and what is useful for is obviously it might not be the case that you write applications in different lengths which is every day let's say it's your work but it might be the case for example that you have your application written in one language and then it comes the moment when you need to let's say use some huge library or something from another language and instead of writing your whole application to use those tools from other languages what you can do is just use growl VM to bring all the things from other languages in your existing application and yeah it is the zero opera Interop with zero zero overhead meaning that your applications that will be really performant and you will get to use all those languages together also you can use one side for all the languages one set of programming tools which is really useful too so how do you enable using Ruby R or Python in Bravo VM because when you download it right ahead you get Java JavaScript LLVM and if you want to use Ruby are a Python what you need to do is just run this one simple commands to add additional capabilities and you can just then install that afterwards if you know lor again no longer need those one more damn I want to show you the example of application which is polyglot meaning it is combining a few languages together I have this demo of polygon application here it can even say from the title that it is combining JavaScript Java in R in one application and what I want to do is I will run it without an odd launcher then I will specify that I want to run it on GBM and that this that is going to be a polyglot application and then I just give it the actual file yeah it's up and running and let's take a look of what it does oh and I didn't show you what actually is the application but is like the best part how all those languages are coming together so here is the actual application you see here that yeah you see here that we have JavaScript code in here also if you take a closer look there is a big integer coming from Java and down below here we have our programming languages for those of you who haven't been working with our it's like a language which is widely used for things like statistics and graphics and data processing this kind of things so all those languages are here in one file and here is the result so here it's what is working doing this my small application and you can see that here we here title here is this big integer coming from Java and the cloud plot itself is created by our the very first request when I run the application is taken slightly longer because we need to initialize three languages context there and you remember there is JavaScript our and Java and we need to initialize all of that but all of the next applications I mean I'm updating the page right now and all the next application requests around and really fast and you can also see that the image is rebuildin itself each time so it's not that I'm showing a European G to be pretended it's our it's really coming from there so that's an example of polyglot application and where you can use it obviously the best I guess one of the most common and practical scenarios would be to enrich your resistant application with new capabilities that grow VM can offer you like new tools new languages for this kind of things because it really doesn't make sense to rewrite the whole application if you just need access to some smaller thing in the other language performance performance is something I think we all care about and here is what you'll VM can offer in terms of performance so for Java we have seen the dam apart for Scala any Scala people in here Oh see you one person okay so for Scala we have really good results and and if you want to learn more about it you can take a look and have a medium block they have this blog post where we showed the benchmarks the actual result of skull applications running on Ravi m and here is the performance boost you can expect from growl VM for Scala so in a orange color here is growl VM Community Edition and which gives around ten percent of performance boost and the dark red one is relevant Enterprise Edition it gives even more performance but as a drop-in replacement which is really easy for you to use I think it is worth paying attention to grow a VM if you are working at least with Java and Scala and that is what we've covered so far more examples coming soon for JavaScript we are compatible with the latest standards and the performance you can see here it's really also good so if you're working JavaScript pay attention to grow a VM checking your workload and give us feedback we'll be happy to hear what's working for you and what is your results and what are you getting from their native images how many of you have heard about broad VM native images ok a lot I'm happy to see that so native images is this technology offered by growl VM which allows you to take your application and to pack it into one binary that would be fully working and you can run it on a machine that for example has never seen JVM has no idea what G BM is and it'll be fully working fully functional by itself so it is instant stuff it gives you instant startup involved footprint and perhaps it is something that you will be really interested for example if you're working with stains like clouds and micro services it works with memory management santeri perhaps would be expecting if you're working with java or for security situation and it's ahead of time compiled meaning your application will be compiled ahead of time and you can run it as it is and here you can see that as a bottom here we have something that we call substrate vm so it's the kind of virtual machine memory components that enable your application to be running and they'll enable it to be independent and run by itself how it works so we analyze your existing application analyze all the dependencies that it has then we compile it into one file optimize it and in the end you have this binary and another thing that you have in the end is image heap meaning that your application wall starts would be already running with the pre-generated version of heap and you can think of it as of like snapshot in technology where all of that will be available from the very beginning let's see how it works okay so I have this dam here to show you the whole process of building a native image with Bravo VM and you can see here that I have this lease dear Java file here and I will show you what it does in a second but first I need to compile it because as an input for night two images utility you would need byte codes so I'm gonna compile it yeah and now as I have it I can run a native image you didn't write a native image it's really fairly simple command and I give it this file that we've got before that it started building so right now it will perform all of the things that we've been talking before like it will perform analyzes will understand what is reachable what's needed to be in your final application for it to be working will then optimize all of the parts of that and in the end what we will get is this one file which is really small and also starts from the files and we can run it everywhere and get this performance get this startup and low memory consumption benefits so now it has finished let me run it in two modes so the first time I will run it like in a regular Java setup and the second time I will run the native image and we will see what both of the versions do and what is the difference of time that they require to start up so the first time I will just run the regular file and I'm going to time it so that we can see the difference that we get and the second time I'm gonna run the generated native image so you see the tables did the same thing so basically it's like a very small program which works down the directory looks for all the files around there and prints out the information of what it find what is the total size of the files and how many other so you see that they both did the same thing right like total is 8 files in the both version that our size is the same but the times at the time that was version required is so much different so that is something that really I think can be useful for you in as I mentioned environments like clouds and micro services like from the top of my head and as example that when I show you here is that you can see the bravia native image is here in on top in green and you can barely see it because it starts so so fast and below you can see the memory that it requires to run another example that I wanna share with you is this recently launched Parker's framework where we can see that growl VM requires so much less time and resources to be run you can see that it's here in this bright color and the chart is so much smaller also I wanted to share with you our recent project updates for those who have been following it and are curious what's in there so one of the things I wanna share with you is liberal so it's a very new thing which we launched a few weeks ago it's a pre compiled version of rel compiler meaning that it gives even more startup benefits and also it kind of avoids interfering with the application heap so if you get profiling information more precise another thing I want to mention is native images isolates so you can run multiple tasks in the same via a virtual machine instance and we have really great really detailed article about on our medium blog for those of you who can be interested in this kind of things I recommend you checking it just one more thing I want to isolate is that all each isolate isolate consumes kind of memory separate list for example garbage collection would be performed for each particular thing and will not interfere with eyes with other isolate entities and and I sustained easy for those of you who are interested in 90 inches is that we have this update that there is new moment plugin and new approach to configuration so it makes for you even like more simple more convenient way to work with grow vm native images and yet here is our blog lots of our team members lots of our engineers write articles in there sorry command you check on it for things like use cases and what is under the hood you can read all of that in their use cases I'm going to mention a few examples from the real world of people who are using grow a vm right now if you've been following grow em topic perhaps you have been visiting at least one of Chris town girls talks about how they use rel compiler in Twitter and how they save money by getting this performance benefit from girl compiler from the community version another interesting example I think is Goldman Sachs example where they have this huge custom programming languages they created themselves something like 25 years ago and now they're run trying to run it on gravy on platform and get access to the tools and other benefits that gravy M offers a few more examples which I cannot cover in this presentation because the time limitation but you can check them Stu we have this great article top 10 things which you can do with grow vm and they kind of show you how many things are in there and I'm sure that it's not even an extensive list there are maybe even more and I will be happy to hear from you if you have tried the VM for something that I haven't covered yet or rehan thirdly additive and how well it did work out for you so just to summarize if you're getting to the end of the presentation why Rollo the end was interesting for you why you should check it in my opinion is it you can make your Java GM applications run faster you can you can get instant startup low footprint and save lots of time and memory and money in clouds also you can enrich your existing environment wherever your work and withdrawal DM capabilities and it can offer you this smooth interrupts between different languages to get started yeah please check out our growl VM the orc website download it check the documentation let us know what you think and if you want to share your feedback with us and we care about each particular feedback that we gave that we get from you here always to stay in touch with us for the updates I recommend it for following our twitter account because all of the newest information goes in there also we have this subscription list and github repository I already mentioned and we have also guitar chat rooms a few of them if you have some challenge or issue with your project and run in royal VM just reaches us in there and we are very like active very social and we will reply and hopefully we'll help you with that so that's all that I wanted to tell you please come to me if you have some questions or feedback and I would be happy to hear from your experience with growl VM thank you [Applause]
Info
Channel: Oracle Developers
Views: 13,278
Rating: undefined out of 5
Keywords: oracle, oracle cloud, oracle developers, cloud, cloud computing, platform, infrastructure
Id: iXCVaQzXi5w
Channel Id: undefined
Length: 34min 59sec (2099 seconds)
Published: Thu Apr 04 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.