Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Supercharge Your Applications with GraalVM
Supercharge Your Applications with GraalVM

Supercharge Your Applications with GraalVM: Hands-on examples to optimize and extend your code using GraalVM's high performance and polyglot capabilities

eBook
$9.99 $43.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

Supercharge Your Applications with GraalVM

Chapter 1: Evolution of Java Virtual Machine

This chapter will walk you through the evolution of Java Virtual Machine (JVM), and how it optimized the interpreter and compiler. We will learn about C1 and C2 compilers and various types of code optimizations that the JVM performs to run Java programs faster.

In this chapter, we will cover the following topics:

  • Introduction to GraalVM
  • Learning how JVM works
  • Understanding the JVM architecture
  • Understanding the kind of optimizations JVM performs with Just-In-Time (JIT) compilers
  • Learning the pros and cons of the JVM approach

By the end of this chapter, you will have a clear understanding of the JVM architecture. This is critical in understanding the GraalVM architecture and how GraalVM further optimizes and builds on top of JVM best practices.

Technical requirements

This chapter does not require any specific software/hardware.

Introduction to GraalVM

GraalVM is a high-performance VM that provides the runtime for modern cloud-native applications. Cloud-native applications are built based on the service architecture. The microservice architecture changes the paradigm of building micro applications, which challenges the fundamental way we build and run applications. The microservices runtimes demand a different set of requirements.

Here are some of the key requirements of a cloud-native application built on the microservice architecture:

  • Smaller footprint: Cloud-native applications run on the "pay for what we use" model. This means that the cloud-native runtimes need to have a smaller memory footprint and should run with the optimum CPU cycles. This will help run more workloads with fewer cloud resources.
  • Quicker bootstrap: Scalability is one of the most important aspects of container-based microservices architecture. The faster the application's bootup, the faster it can scale the clusters. This is even more important for serverless architectures, where the code is initialized and run and then shut down on request.
  • Polyglot and interoperability: Polyglot is the reality; each language has its strengths and will continue to. Cloud-native microservices are being built with different languages. It's very important to have an architecture that embraces the polyglot requirements and provides interoperability across languages. As we move to modern architectures, it's important to reuse as much code and logic as possible, that is time-tested and critical for business.

GraalVM provides a solution to all these requirements and provides a common platform to embed and run polyglot cloud-native applications. It is built on JVM and brings in further optimizations. Before understanding how GraalVM works, it's important to understand the internal workings of JVM.

Traditional JVM (before GraalVM) has evolved into the most mature runtime implementation. While it has some of the previously listed requirements, it is not built for cloud-native applications, and it comes with its baggage of monolith design principles. It is not an ideal runtime for cloud-native applications.

This chapter will walk you through in detail how JVM works and the key components of the JVM architecture.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Generate faster and leaner code with minimum computing resources for high performance
  • Compile Java applications faster than ever to a standalone executable called native images
  • Create high-performance polyglot applications that are compatible across various JVM and non-JVM languages

Description

GraalVM is a universal virtual machine that allows programmers to compile and run applications written in both JVM and non-JVM languages. It improves the performance and efficiency of applications, making it an ideal companion for cloud-native or microservices-based applications. This book is a hands-on guide, with step-by-step instructions on how to work with GraalVM. Starting with a quick introduction to the GraalVM architecture and how things work under the hood, you'll discover the performance benefits of running your Java applications on GraalVM. You'll then learn how to create native images and understand how AOT (ahead-of-time) can improve application performance significantly. The book covers examples of building polyglot applications that will help you explore the interoperability between languages running on the same VM. You'll also see how you can use the Truffle framework to implement any language of your choice to run optimally on GraalVM. By the end of this book, you'll not only have learned how GraalVM is beneficial in cloud-native and microservices development but also how to leverage its capabilities to create high-performing polyglot applications.

Who is this book for?

This book is for JVM developers looking to optimize their application's performance. You'll also find this book useful if you're a JVM developer looking to explore options to develop polyglot applications using tools from the Python, R, Ruby, or Node.js ecosystem. A solid understanding of software development concepts and prior experience working with programming languages is necessary to get started.

What you will learn

  • Gain a solid understanding of GraalVM and how it works under the hood
  • Work with GraalVM s high performance optimizing compiler and see how it can be used in both JIT (just-in-time) and AOT (ahead-of-time) modes
  • Get to grips with the various optimizations that GraalVM performs at runtime
  • Use advanced tools to analyze and diagnose performance issues in the code
  • Compile, embed, run, and interoperate between languages using Truffle on GraalVM
  • Build optimum microservices using popular frameworks such as Micronaut and Quarkus to create cloud-native applications
Estimated delivery fee Deliver to United States

Economy delivery 10 - 13 business days

Free $6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Aug 10, 2021
Length: 360 pages
Edition : 1st
Language : English
ISBN-13 : 9781800564909
Category :
Languages :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to United States

Economy delivery 10 - 13 business days

Free $6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Publication date : Aug 10, 2021
Length: 360 pages
Edition : 1st
Language : English
ISBN-13 : 9781800564909
Category :
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 150.97
Supercharge Your Applications with GraalVM
$54.99
Modern API Development with Spring and Spring Boot
$48.99
Designing Hexagonal Architecture with Java
$46.99
Total $ 150.97 Stars icon
Banner background image

Table of Contents

16 Chapters
Section 1: The Evolution of JVM Chevron down icon Chevron up icon
Chapter 1: Evolution of Java Virtual Machine Chevron down icon Chevron up icon
Chapter 2: JIT, HotSpot, and GraalJIT Chevron down icon Chevron up icon
Section 2: Getting Up and Running with GraalVM – Architecture and Implementation Chevron down icon Chevron up icon
Chapter 3: GraalVM Architecture Chevron down icon Chevron up icon
Chapter 4: Graal Just-In-Time Compiler Chevron down icon Chevron up icon
Chapter 5: Graal Ahead-of-Time Compiler and Native Image Chevron down icon Chevron up icon
Section 3: Polyglot with Graal Chevron down icon Chevron up icon
Chapter 6: Truffle for Multi-language (Polyglot) support Chevron down icon Chevron up icon
Chapter 7: GraalVM Polyglot – JavaScript and Node.js Chevron down icon Chevron up icon
Chapter 8: GraalVM Polyglot – Java on Truffle, Python, and R Chevron down icon Chevron up icon
Chapter 9: GraalVM Polyglot – LLVM, Ruby, and WASM Chevron down icon Chevron up icon
Section 4: Microservices with Graal Chevron down icon Chevron up icon
Chapter 10: Microservices Architecture with GraalVM Chevron down icon Chevron up icon
Assessments Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Full star icon 5
(21 Ratings)
5 star 95.2%
4 star 4.8%
3 star 0%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




sangeeth Kumar Aug 10, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I got a previledge to be the early reader of such a wonder book! Here is my review..When I read the last page of the book, I realised that the very old idiom "don't judge a book by its cover" applies so good to this book. This book is much more than what the title/ cover tells. I would probably name it as - "Super charge your brain with GraalVM".The author has beautifully orchestrated the chapters like a story. Recommendation to the readers is to start from the beginning to enjoy the journey, rather than jumping to the specific topic by checking index.About the content and the very subject "GraalVM & its performance", this book not only explains 'what and how', but also ‘why' by explaining the fundamentals such as role of C1, C2 compilers, JIT, AHOTs etc to the detailed possible way. Author also has provided the visuals & installations steps wherever applicable. so we not only read and understand but also easily replicate it ourself to validate the same. I liked the fact that every section have some kind of repeated reference & details to previous chapters as we read forward - which actual helps to refresh the memory and relate the concepts with better understanding.Another cool thing is the usage of language -Though the subject is pretty new and complex, I find it easy to understand and grasp - Thanks to usage of simple english words and common vocabularies. Simple and elegant block diagrams are very useful.I started reading this book presuming that I would get an idea of what is Graal VM & how to use it. But when I finished, the learning was beyond the GraalVM. Got a different perspective about Java language itself. Most of the popular language integration with polyglot support are individually explained in detail. So you are not only left with one example to get an idea and figure out yourself how to do the same for other language.I recommend this book not only to the developers & architects who are into cloud & micro-service world, but even to the front end developers with basic Java knowledge, because you will learn the fundamentals even better. Lastly, even if you are someone not interested in basics and just want - 'know how’, read the last few chapters which explains in details - how to install and deploy the services with GraalVM. At the end, I am supercharged!! Happy reading.
Amazon Verified review Amazon
Jermaine Feb 08, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
It was refreshing to read the practical usage of GraalVM in the context of Cloud-Native microservices. The book provided a great introduction to GraalVM and how GraalVM can be leveraged with polyglot technology such as NodeJS and Java to optimize microservice applications. I enjoyed the hands-on examples to showcase simple and complex use cases, including a microservice case study example. Overall, the book is an excellent read for software engineers and architects looking for hands-on learning of GraalVM.
Amazon Verified review Amazon
Naveen Purushothaman Aug 11, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Lucky to receive an early copy of the book.The book starts by providing an overview of JVM evolution and provides a good introduction to JVM. Then it is a real deep journey to GraalVM. However, one key thing to note is the special focus from the author to keep the complex simple. Easy to understand diagrams and textual explanation makes it a real joy to read the book. Moreover, the hands-on exercises and accompanying detailed explanations keeps everything grounded. Technology moves very fast and it is not so often we see a book like this, which is covering everything around the relatively new technology so comprehensively. I strongly feel that this GraalVM bible should be prescribed as a text book for students focused at computer science.
Amazon Verified review Amazon
Gokul Alex Mar 12, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I am amazed at the bewildering variety of compiler techniques covered by this book. It is written in a direct and dynamic language that makes the book quite accessible to every engineer who has used Java Programming language at least once. This book is written with enough details so that we can consider it as an essential reference on Graal VM and its internal elements. Graal VM has achieved the goal of writing a Java Virtual Machine in Java itself, aiming to address the problems inherited from its roots in C++ such as memory leaks. Graal Graph is really an exciting idea that I have come across in this book. AST Rewriting and Partial Evaluation are quite interesting. Polyglot APIs are empowering Java to embed languages such as R to perform statistical and machine learning programs. The exotic combination of Truffle and Graal promises a new world of interoperability. Some of the concepts used by GraalVM such as partial evaluations are intimately connected to the revolutionary programming languages such as Lisp. Identification of new data types through profiling is indeed a novel idea. As we get into the final chapter on how GraalVM is a great choice for microservices architecture through its common runtime, multiple language support and interoperability, it reaches a meaningful conclusion. It is also nice to see how GraalVM provides security for micro services through its sandbox model. All together this book is an exciting journey into the exotic world of polyglot programming and powerful optimisations.
Amazon Verified review Amazon
Amazon Customer Oct 08, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Different from other books that teach you how to build web services, this book takes an unconventional path and starts from JVM -- the "engine" of the entire application stack. Explaining how different parts of JVM affects overall performance and how GraalVM stands out in these key sectors, compared to HotSpot VM, the default JVM came with JDK. I personally found this part of the book most interesting. Another highlight in later chapters is the introduction to different programming languages supported by GraalVM. Which gives a practical guide for engineers to adopt these runtimes and really shows GraalVM's versatility.Overall it's an useful and insightful book for developers and power users to build high-performance microservices.Note: I received this book for free.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela