-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into pfg/e-string-changes-2
- Loading branch information
Showing
630 changed files
with
53,298 additions
and
28,079 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Add directories or file patterns to ignore during indexing (e.g. foo/ or *.csv) | ||
bench | ||
vendor | ||
*-fixture.{js,ts} | ||
zig-cache | ||
packages/bun-uws/fuzzing | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Lint | ||
|
||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
env: | ||
BUN_VERSION: "1.1.38" | ||
OXLINT_VERSION: "0.15.0" | ||
|
||
jobs: | ||
lint-js: | ||
name: "Lint JavaScript" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Bun | ||
uses: ./.github/actions/setup-bun | ||
with: | ||
bun-version: ${{ env.BUN_VERSION }} | ||
- name: Lint | ||
run: bunx oxlint --config oxlint.json --quiet --format github | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Typos | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Spellcheck | ||
uses: crate-ci/[email protected] | ||
with: | ||
files: docs/**/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
command script import vendor/zig/tools/lldb_pretty_printers.py | ||
# command script import vendor/zig/tools/lldb_pretty_printers.py | ||
command script import vendor/WebKit/Tools/lldb/lldb_webkit.py | ||
|
||
# type summary add --summary-string "${var} | inner=${var[0-30]}, source=${var[33-64]}, tag=${var[31-32]}" "unsigned long" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# To learn more about git's mailmap: https://ntietz.com/blog/git-mailmap-for-name-changes | ||
chloe caruso <[email protected]> <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[type.md] | ||
extend-ignore-words-re = ["^ba"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.1.39 | ||
1.1.42 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { Buffer } from "node:buffer"; | ||
import { bench, run } from "../runner.mjs"; | ||
|
||
const variations = [ | ||
["latin1", "hello world"], | ||
["utf16", "hello emoji 🤔"], | ||
]; | ||
|
||
for (const [label, string] of variations) { | ||
const big = Buffer.alloc(1000000, string).toString(); | ||
const small = Buffer.from(string).toString(); | ||
const substring = big.slice(0, big.length - 2); | ||
|
||
bench(`${substring.length}`, () => { | ||
return Buffer.byteLength(substring, "utf8"); | ||
}); | ||
|
||
bench(`${small.length}`, () => { | ||
return Buffer.byteLength(small); | ||
}); | ||
|
||
bench(`${big.length}`, () => { | ||
return Buffer.byteLength(big); | ||
}); | ||
} | ||
|
||
await run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { bench, run } from "../runner.mjs"; | ||
import { brotliCompress, brotliDecompress, createBrotliCompress, createBrotliDecompress } from "node:zlib"; | ||
import { promisify } from "node:util"; | ||
import { pipeline } from "node:stream/promises"; | ||
import { Readable } from "node:stream"; | ||
import { readFileSync } from "node:fs"; | ||
|
||
const brotliCompressAsync = promisify(brotliCompress); | ||
const brotliDecompressAsync = promisify(brotliDecompress); | ||
|
||
const testData = | ||
process.argv.length > 2 | ||
? readFileSync(process.argv[2]) | ||
: Buffer.alloc(1024 * 1024 * 16, "abcdefghijklmnopqrstuvwxyz"); | ||
let compressed; | ||
|
||
bench("brotli compress", async () => { | ||
compressed = await brotliCompressAsync(testData); | ||
}); | ||
|
||
bench("brotli decompress", async () => { | ||
await brotliDecompressAsync(compressed); | ||
}); | ||
|
||
bench("brotli compress stream", async () => { | ||
const source = Readable.from([testData]); | ||
const compress = createBrotliCompress(); | ||
await pipeline(source, compress); | ||
}); | ||
|
||
bench("brotli decompress stream", async () => { | ||
const source = Readable.from([compressed]); | ||
const decompress = createBrotliDecompress(); | ||
await pipeline(source, decompress); | ||
}); | ||
|
||
await run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { bench, run } from "../runner.mjs"; | ||
import zlib from "node:zlib"; | ||
import { promisify } from "node:util"; | ||
|
||
const deflate = promisify(zlib.deflate); | ||
const inflate = promisify(zlib.inflate); | ||
|
||
const short = "Hello World!"; | ||
const long = "Hello World!".repeat(1024); | ||
const veryLong = "Hello World!".repeat(10240); | ||
|
||
// Pre-compress some data for decompression tests | ||
const shortBuf = Buffer.from(short); | ||
const longBuf = Buffer.from(long); | ||
const veryLongBuf = Buffer.from(veryLong); | ||
|
||
let [shortCompressed, longCompressed, veryLongCompressed] = await Promise.all([ | ||
deflate(shortBuf, { level: 6 }), | ||
deflate(longBuf, { level: 6 }), | ||
deflate(veryLongBuf, { level: 6 }), | ||
]); | ||
|
||
const format = new Intl.NumberFormat("en-US", { notation: "compact", unit: "byte" }); | ||
// Compression tests at different levels | ||
bench(`deflate ${format.format(short.length)}B (level 1)`, async () => { | ||
await deflate(shortBuf, { level: 1 }); | ||
}); | ||
|
||
bench(`deflate ${format.format(short.length)} (level 6)`, async () => { | ||
await deflate(shortBuf, { level: 6 }); | ||
}); | ||
|
||
bench(`deflate ${format.format(long.length)} (level 1)`, async () => { | ||
await deflate(longBuf, { level: 1 }); | ||
}); | ||
|
||
bench(`deflate ${format.format(long.length)} (level 6)`, async () => { | ||
await deflate(longBuf, { level: 6 }); | ||
}); | ||
|
||
bench(`deflate ${format.format(veryLong.length)} (level 1)`, async () => { | ||
await deflate(veryLongBuf, { level: 1 }); | ||
}); | ||
|
||
bench(`deflate ${format.format(veryLong.length)} (level 6)`, async () => { | ||
await deflate(veryLongBuf, { level: 6 }); | ||
}); | ||
|
||
// Decompression tests | ||
bench(`inflate ${format.format(short.length)}`, async () => { | ||
await inflate(shortCompressed); | ||
}); | ||
|
||
bench(`inflate ${format.format(long.length)}`, async () => { | ||
await inflate(longCompressed); | ||
}); | ||
|
||
bench(`inflate ${format.format(veryLong.length)}`, async () => { | ||
await inflate(veryLongCompressed); | ||
}); | ||
|
||
await run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.