当前位置: 首页 > news >正文

GraalVM的资料

  • 官网

    An advanced JDK with ahead-of-time Native Image compilation.

  • 代码社区

  • 下载主页

  • 文档主页

    GraalVM compiles your Java applications ahead of time into standalone binaries. These binaries are smaller, start up to 100x faster, provide peak performance with no warmup, and use less memory and CPU than applications running on a Java Virtual Machine (JVM).

    在编译期,将字节码转换为机器码。

    GraalVM reduces the attack surface of your application. It excludes unused classes, methods, and fields from the application binary. It restricts reflection and other dynamic Java language features to build time only. It does not load any unknown code at run time.

    在编译器,裁剪、消除掉应用程序在运行时不需要、不使用、不加载的类和代码,减少目标应用程序的大小。类似gcc/clang提供的编译选项-ffunction-sections -fdata-sections -Wl,-gc-sections

  • GraalVM Documentation

Getting Started

  • Getting Started

    GraalVM compiles your Java applications ahead of time into standalone binaries that start instantly, provide peak performance with no warmup, and use fewer resources.

Native Image

  • Native Image

    创建验证项目,执行如下命令:

     mvn archetype:generate -DgroupId=com.example -DartifactId=helloworld -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
    

    构建可执行的jar,修改项目的pom.xml,增加如下配置:

    <build><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>3.12.1</version><configuration><fork>true</fork></configuration></plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-jar-plugin</artifactId><version>3.3.0</version><configuration><archive><manifest><mainClass>com.example.App</mainClass><addClasspath>true</addClasspath></manifest></archive></configuration></plugin></plugins>
    </build>
    

    使用graalvm转换为本地代码,修改pom.xml,增加如下配置:

    <profiles><profile><id>native</id><build><plugins><plugin><groupId>org.graalvm.buildtools</groupId><artifactId>native-maven-plugin</artifactId><version>${native.maven.plugin.version}</version><extensions>true</extensions><executions><execution><id>build-native</id><goals><goal>compile-no-fork</goal></goals><phase>package</phase></execution><execution><id>test-native</id><goals><goal>test</goal></goals><phase>test</phase></execution></executions></plugin></plugins></build></profile>
    </profiles>
    

    启动构建,执行如下命令:

    mvn -Pnative package
    
  • User Guides

  • Native Image Basics

Build
  • Build Overview
    native-image的常见命令行样例。

  • Build Output
    执行native-image构建时,命令行的输出信息。

  • Build Configuration
    在jar中增加native-image的配置文件,用于指示构建选项,配置文件的位置,样例如下:

    META-INF/
    └── native-image└── groupID└── artifactID└── native-image.properties
    

    groupID/artifactID如何确定?
    通过学习官方提供的样例,快速上手native-image的使用方法。

  • Bundles
    对于使用maven管理、构建的项目,修改项目的pom.xml,增加如下配置:

    <plugin><groupId>org.graalvm.buildtools</groupId><artifactId>native-maven-plugin</artifactId><configuration><buildArgs combine.children="append"><buildArg>--bundle-create</buildArg></buildArgs></configuration>
    </plugin>
    

    构建软件时,执行如下命令:

    ./mvnw package -Dpackaging=native-image
    
  • Command-line Options
    native-image的选项。

Reachability Metadata
  • Reachability Metadata
Optimizations and Performance
  • Optimizations and Performance
  • Profile-Guided Optimization
  • Memory Management
  • Class Initialization
Debugging and Diagnostics
  • Debugging and Diagnostics
  • Create a Heap Dump from a Native Executable
  • Points-to Analysis Reports
Dynamic Features
  • Dynamic Features
Interoperability with Native Code
  • Interoperability with Native Code

  • JVM JNI Invocation API

  • GraalVM JNI Invocation API

  • Native Image C API

  • LLVM Backend for Native Image

Reference Manuals

  • GraalVM Reference Manuals
Java and JVM
  • Java and JVM
Java on Truffle
  • Java on Truffle
  • Interoperability with Truffle Languages
  • Implementation Details

    Java on Truffle is a minified Java VM that implements all core components of JVM.

  • Enhanced HotSwap Capabilities
  • Running Demo Applications
  • FAQ

http://www.mrgr.cn/news/22516.html

相关文章:

  • 组件拆分综合案例——商城首页
  • 第T6周:好莱坞明星识别
  • 线性因子模型 - 独立分量分析(ICA)篇
  • Go语言现代web开发04 变量常量以及类型转换
  • 机器学习TFIDF的情感分类文章
  • 寻找身高相近的小朋友
  • 数据结构与算法03 顺序表+链表
  • 沁恒CH32在MounRiver Studio上环境配置以及使用详细教程
  • 最大公因数:欧几里得算法
  • goreplay流量重放备忘
  • Linux 文件查找命令which,find详解
  • 使用SSH KEY
  • JavaFx生成树型结构
  • 键盘快捷键:提高工作效率与电脑操作的利器
  • ThreadLocal 释放的方式有哪些
  • 【每日一题】LeetCode 2181.合并零之间的节点(链表、模拟)
  • Go开源日志库Logrus的使用
  • Matlab simulink建模与仿真 第十一章(端口及子系统库)【下】
  • 衡石分析平台使用手册-单机安装及启动
  • 语音识别转文字工具:办公效率的得力助手