I'm pleased to announce Javet v0.8.0 is released. Javet is an awesome way of embedding V8 and Node.js in Java.
The new release brings Node.js v14.16.0 + V8 v8.9.255😀
Now, Javet supports both Node.js mode and V8 mode both of which can co-exist in one JVM. In other words, they can run side by side and don't interfere with each other.
As the diagram shows, Javet loads V8 v8.9+ in the default classloader as an out-of-box solution. Node.js is lazy loaded in a custom classloader. Detailed comparisons are as following.
Feature | Node.js Mode | V8 Mode |
---|---|---|
Built-in | No | Yes |
Customization | High | High |
Node.js Ecosystem | Complete | No |
Security | Low | High |
Unload | Potentially Yes | No |
V8 Ecosystem | Complete | Complete |
V8 Version | Low | High |
One of the beauties of Javet is all the features in V8 mode can be applied to Node.js mode. Here are some examples.
- Virtualization - All Node.js modules can be virtualized. E.g.
console
,fs
,HTTP
,Net
,OS
, etc. - Zero-copy - JVM can share the same byte buffer with Node.js and V8 to achieve zero-copy.
- Multi-threading - Multiple Java threads can host multiple Node.js runtime instances with only one copy of V8 objects visible to those instances.
- Beyond Node.js - Javet allows explicit
await()
so that applications can take more control overasync
execution.
No comments:
Post a Comment