mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 23:34:47 -05:00
A modern runtime for JavaScript and TypeScript.
https://deno.com/
16b7c9cd8d
This PR introduces an optimization to `set_response` to reduce the overhead for responses with a payload size less than 64 bytes. Performance gains are more noticeable when `is_request_compressible` enters the slow path, ie: `-H 'Accept-Encoding: unknown'` ### Benchmarks ```js Deno.serve({ port: 3000 }, () => new Response("hello")); ``` ``` wrk -d 10s --latency -H 'Accept-Encoding: slow' http://127.0.0.1:3000 ``` --- **main** ``` Running 10s test @ http://127.0.0.1:3000 2 threads and 10 connections Thread Stats Avg Stdev Max +/- Stdev Latency 44.72us 28.12us 3.10ms 97.95% Req/Sec 112.73k 8.25k 123.66k 91.09% 2264092 requests in 10.10s, 308.77MB read Requests/sec: 224187.08 Transfer/sec: 30.57MB ``` **this PR** ``` Running 10s test @ http://127.0.0.1:3000 2 threads and 10 connections Thread Stats Avg Stdev Max +/- Stdev Latency 42.91us 20.57us 2.04ms 97.36% Req/Sec 116.61k 7.95k 204.81k 88.56% 2330970 requests in 10.10s, 317.89MB read Requests/sec: 230806.32 Transfer/sec: 31.48MB ``` |
||
---|---|---|
.cargo | ||
.devcontainer | ||
.github | ||
bench_util | ||
cli | ||
ext | ||
runtime | ||
test_ffi | ||
test_napi | ||
test_util | ||
tools | ||
.dlint.json | ||
.dprint.json | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
.gitmodules | ||
.rustfmt.toml | ||
Cargo.lock | ||
Cargo.toml | ||
LICENSE.md | ||
README.md | ||
Releases.md | ||
rust-toolchain.toml |
Deno
Deno is a simple, modern and secure runtime for JavaScript and TypeScript that uses V8 and is built in Rust.
Features
- Secure by default. No file, network, or environment access, unless explicitly enabled.
- Provides
web platform functionality and APIs,
e.g. using ES modules, web workers, and
fetch()
. - Supports TypeScript out of the box.
- Ships only a single executable file.
- Built-in tooling including
deno test
,deno fmt
,deno bench
, and more. - Includes a set of reviewed standard modules guaranteed to work with Deno.
- Supports npm.
Install
Shell (Mac, Linux):
curl -fsSL https://deno.land/install.sh | sh
PowerShell (Windows):
irm https://deno.land/install.ps1 | iex
Homebrew (Mac):
brew install deno
Chocolatey (Windows):
choco install deno
Scoop (Windows):
scoop install deno
Build and install from source using Cargo:
# Install the Protobuf compiler
apt install -y protobuf-compiler # Linux
brew install protobuf # macOS
# Build and install Deno
cargo install deno --locked
See deno_install and releases for other options.
Getting Started
deno run https://deno.land/std/examples/welcome.ts
Or setup a simple HTTP server:
Deno.serve((_req) => new Response("Hello, World!"));
Additional Resources
- The Deno Manual is a great starting point for additional examples, setting up your environment, using npm, and more.
- Runtime API reference documents all APIs built into Deno CLI.
- Deno Standard Modules do not have external dependencies and are reviewed by the Deno core team.
- deno.land/x is the registry for third party modules.
- Blog is where the Deno team shares important product updates and “how to”s about solving technical problems.
Contributing
We appreciate your help!
To contribute, please read our contributing instructions.