百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
L

llrt

> 编程语言
开源

LLRT(低延迟运行时)是一种实验性的、轻量级的 JavaScript 运行时,旨在满足对快速高效的无服务器应用程序的日益增长的需求。

8.8K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

LLRT(低延迟运行时)是一种实验性的、轻量级的 JavaScript 运行时,旨在满足对快速高效的无服务器应用程序的日益增长的需求。

LLRT (Low Latency Runtime) is a lightweight JavaScript runtime designed to address the growing demand for fast and efficient Serverless applications. LLRT offers up to over 10x faster startup and up to 2x overall lower cost compared to other JavaScript runtimes running on AWS Lambda

It's built in Rust, utilizing QuickJS as JavaScript engine, ensuring efficient memory usage and swift startup.

[!WARNING] LLRT is an experimental package. It is subject to change and intended only for evaluation purposes.

LLRT - DynamoDB Put, ARM, 128MB:

Node.js 20 - DynamoDB Put, ARM, 128MB:

HTTP benchmarks measured in round trip time for a cold start (why?)

Configure Lambda functions to use LLRT

Download the last LLRT release from https://github.com/awslabs/llrt/releases

Option 1: Custom runtime (recommended)

Choose Custom Runtime on Amazon Linux 2023 and package the LLRT bootstrap binary together with your JS code.

Option 2: Use a layer

Choose Custom Runtime on Amazon Linux 2023, upload llrt-lambda-arm64.zip or llrt-lambda-x64.zip as a layer and add to your function

Option 3: Package LLRT in a container image

See our AWS SAM example or:

FROM --platform=arm64 busybox
WORKDIR /var/task/
COPY app.mjs ./
ADD https://github.com/awslabs/llrt/releases/latest/download/llrt-container-arm64 /usr/bin/llrt
RUN chmod +x /usr/bin/llrt

ENV LAMBDA_HANDLER "app.handler"

CMD [ "llrt" ]

Option 4: AWS SAM

The following example project sets up a lambda instrumented with a layer containing the llrt runtime.

Option 5: AWS CDK

You can use cdk-lambda-llrt construct library to deploy LLRT Lambda functions with AWS CDK.

import { LlrtFunction } from "cdk-lambda-llrt";

const handler = new LlrtFunction(this, "Handler", {
  entry: "lambda/index.ts",
});

See Construct Hub and its examples for more details.

That's it

[!IMPORTANT] Even though LLRT supports ES2023 it's NOT a drop in replacement for Node.js. Consult Compatibility matrix and API for more details. All dependencies should be bundled for a browser platform and mark included @aws-sdk packages as external.

Testing & ensuring compatibility

The best way to ensure your code is compatible with LLRT is to write tests and execute them using the built-in test runner. The test runner currently supports Jest/Chai assertions. There are three main types of tests you can create:

Unit Tests

  • Useful for validating specific modules and functions in isolation
  • Allow focused testing of individual components

End-to-End (E2E) Tests

  • Validate overall compatibility with AWS SDK and WinterTC compliance
  • Test the integration between all components
  • Confirm expected behavior from end-user perspective
  • For more information about the E2E Tests and how to run them, see here.

Web Platform Tests (WPT)

  • Useful for validating LLRT’s behavior against standardized browser APIs and runtime expectations
  • Ensure compatibility with web standards and cross-runtime environments
  • Help verify alignment with WinterTC and broader JavaScript ecosystem
  • For setup instructions and how to run WPT in LLRT, see here.

Test runner

Test runner uses a lightweight Jest-like API and supports Jest/Chai assertions. For examples on how to implement tests for LLRT see the /tests folder of this repository.

To run tests, execute the llrt test command. LLRT scans the current directory and sub-directories for files that ends with *.test.js or *.test.mjs. You can also provide a specific test directory to scan by using the llrt test -d <directory> option.

The test runner also has support for filters. Using filters is as simple as adding additional command line arguments, i.e: llrt test crypto will only run tests that match the filename containing crypto.

Compatibility matrix

[!NOTE] LLRT only support a fraction of the Node.js APIs. It is NOT a drop in replacement for Node.js, nor will it ever be. Below is a high level overview of partially supported APIs and modules. For more details consult the API documentation

Node.js API Node.js LLRT
node:assert ✔︎ ✔︎️⚠️
node:async_hooks ✔︎ ✔︎️⚠️
node:buffer ✔︎ ✔︎️⚠️
node:child_process ✔︎ ✔︎⚠️
node:cluster ✔︎ ✘
node:console ✔︎ ✔︎⚠️
node:crypto ✔︎ ✔︎⚠️
node:dgram ✔︎ ✘
node:diagnostics_channel ✔︎ ✘
node:dns ✔︎ ✔︎⚠️
node:events ✔︎ ✔︎⚠️
node:fs ✔︎ ✔︎⚠️
node:fs/promises ✔︎ ✔︎⚠️
node:http ✔︎ ✘⏱
node:http2 ✔︎ ✘
node:https ✔︎ ✘⏱
node:inspector ✔︎ ✘
node:inspector/promises ✔︎ ✘
node:module ✔︎ ✔︎⚠️
node:net ✔︎ ✔︎⚠️
node:os ✔︎ ✔︎⚠️
node:path ✔︎ ✔︎⚠️
node:perf_hooks ✔︎ ✔︎⚠️
node:process ✔︎ ✔︎⚠️
node:querystring ✔︎ ✘
node:readline ✔︎ ✘
node:readline/promises ✔︎ ✘
node:repl ✔︎ ✘
node:sqlite ✔︎ ✘
node:stream ✔︎ ✔︎*
node:stream/promises ✔︎ ✔︎*
node:stream/web ✔︎ ✔︎⚠️
node:string_decoder ✔︎ ✔︎
node:test ✔︎ ✘
node:timers ✔︎ ✔︎⚠️
node:tls ✔︎ ✘⏱
node:tty ✔︎ ✔︎⚠️
node:url ✔︎ ✔︎⚠️
node:util ✔︎ ✔︎⚠️
node:v8 ✔︎ ✘**
node:vm ✔︎ ✘
node:wasi ✔︎ ✘
node:worker_threads ✔︎ ✘
node:zlib ✔︎ ✔︎⚠️
LLRT API Node.js LLRT
llrt:codec ✘ ✔︎
llrt:qjs ✘ ✔︎
llrt:util ✘ ✔︎
llrt:xml ✘ ✔︎
Web Platform API LLRT
COMPRESSION ✘⏱
CONSOLE ✔︎⚠️
DOM ✔︎⚠️
ECMASCRIPT ✔︎⚠️
ENCODING ✔︎⚠️
FETCH ✔︎⚠️
FILEAPI ✔︎⚠️
HR-TIME ✔︎
HTML ✔︎⚠️
STREAMS ✔︎⚠️
URL ✔︎
URLPATTERN ✘⏱
WASM-JS-API-2 ✘
WASM-WEB-API-2 ✘
WEBCRYPTO ✔︎⚠️
WEBIDL ✔︎⚠️
XHR ✔︎⚠️
Other features LLRT
async/await ✔︎
esm ✔︎
cjs ✔︎
Intl ✔︎⚠️
Temporal ✔︎⚠️

⚠️ = partially supported in LLRT
⏱ = planned partial support
* = Not native
** = The module.registerHooks() API allows you to emulate some functionality. See also example/register-hooks.

Using node_modules (dependencies) with LLRT

Since LLRT is meant for performance critical application it's not recommended to deploy node_modules without bundling, minification and tree-shaking.

LLRT can work with any bundler of your choice. Below are some configurations for popular bundlers:

[!WARNING] LLRT implements native modules that are largely compatible with the following external packages. By implementing the following conversions in the bundler's alias function, your application may be faster, but we recommend that you test thoroughly as they are not fully compatible.

Node.js LLRT
fast-xml-parser llrt:xml

ESBuild

esbuild index.js --platform=browser --target=es2023 --format=esm --bundle --minify --external:@aws-sdk --external:@smithy

Rollup

import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import terser from "@rollup/plugin-terser";

export default {
  input: "index.js",
  output: {
    file: "dist/bundle.js",
    format: "esm",
    sourcemap: true,
    target: "es2023",
  },
  plugins: [resolve(), commonjs(), terser()],
  external: ["@aws-sdk", "@smithy"],
};

Webpack

import TerserPlugin from "terser-webpack-plugin";
import nodeExternals from "webpack-node-externals";

export default {
  entry: "./index.js",
  output: {
    path: "dist",
    filename: "bundle.js",
    libraryTarget: "module",
  },
  target: "web",
  mode: "production",
  resolve: {
    extensions: [".js"],
  },
  exter

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rust

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言