LLRT (Low Latency RunTime) is a lightweight Javascript runtime designed to address the growing demand for fast and efficient Serverless applications.
LLRT is 10x faster in startup (Cold Start) and 2x overall lower cost compared to other Javascript runtimes in AWS Lambda.
What is a Cold Start
We make a request on a serverless service where AWS finds a server somewhere in their service which is close to run our necessary data such as the Javascript. The initial provisioning or running the service is called as Cold Start
Once it finds the server it starts loading all the Javascript and then it can process the request and send the response.This takes on a long time depending on how much Javascript you're actually sending and node itself is pretty big which comes around 28MB as the executable that much of data is a necessary blocker for a request. This is for one time because once the server is started up it waits for if there is any more new request that comes in and it is called "Warm Start" because the server is started already
Node.js Vs LLRT Benchmarks
Here is the benchmark results of Node.js 20 for a Cold and Warm Start
The Cold starts in a best case (p0) would take around 1457.93 ms and the worst case of around 1678.28 ms (1.7s) before start responding
But if we see the results of LLRT
For the cold start in LLRT it would take around 48.54ms and the worst case of 85.61ms which is a 10x difference (1500ms Vs 50ms) for the p0
What Makes LLRT to be much faster
LLRT is built with Rust which is been used by many people to build Javascript Dev tools. and the Javascript engine that is been used internally is QuickJS.
Both Node and Deno relies on V8 engine the same javascript engine that is in chrome. whereas the Bun relies on JVC (Javascript Core) which is a part of Safari and the Apple ecosystem.
QuickJS is a C++ based Javascript runtime. Here is the benchmark result of QuickJS compared to other Javascript runtimes.
LLRT includes many AWS SDK clients and utils as part of the runtime, built into the executable. These SDK Clients have been specifically fine-tuned to offer best performance while not compromising on compatibility.
Still LLRT is an early experiment which Amazon is doing on we can see how important and valuable this faster runtime will be in the upcoming days.
Here is the LLRT repo
That's all about LLRT for now. Will catch up with new stuffs. Till then Happy Learning !!!