-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
132 additions
and
18 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
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,51 @@ | ||
import { assert } from "deno/assert/mod.ts" | ||
|
||
const gitVersion = "2.44.0" | ||
|
||
function assertGitOutput(output: Deno.CommandOutput) { | ||
assert(output.code === 0) | ||
assert( | ||
new TextDecoder().decode(output.stdout) === `git version ${gitVersion}\n`, | ||
) | ||
assert(new TextDecoder().decode(output.stderr) === "") | ||
} | ||
|
||
// Run the command before the benchmark to ensure git is bootstrapped | ||
const command = new Deno.Command("./pkgx", { | ||
args: [`git@${gitVersion}`, "--version"], | ||
}) | ||
const output = await command.output() | ||
assertGitOutput(output) | ||
|
||
Deno.bench( | ||
"git --version", | ||
{ permissions: { run: true, env: true }, group: "startup", baseline: true }, | ||
async (b) => { | ||
const gitBin = `${ | ||
Deno.env.get( | ||
"HOME", | ||
) | ||
}/.pkgx/git-scm.org/v${gitVersion}/bin/git` | ||
const command = new Deno.Command(gitBin, { | ||
args: ["--version"], | ||
}) | ||
b.start() | ||
const output = await command.output() | ||
b.end() | ||
assertGitOutput(output) | ||
}, | ||
) | ||
|
||
Deno.bench( | ||
"pkgx git --version", | ||
{ permissions: { run: true }, group: "startup" }, | ||
async (b) => { | ||
const command = new Deno.Command("./pkgx", { | ||
args: [`git@${gitVersion}`, "--version"], | ||
}) | ||
b.start() | ||
const output = await command.output() | ||
b.end() | ||
assertGitOutput(output) | ||
}, | ||
) |
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
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,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This script needs to be executed with dev off | ||
|
||
set -e | ||
|
||
for deno_version in 1.40 1.41 1.42; do | ||
echo "Compiling with deno@${deno_version}..." | ||
pkgx "deno@${deno_version}" task compile | ||
|
||
echo "Benchmarking compiled binary..." | ||
# Use the same deno version for running the benchmark itself | ||
pkgx "deno@1.42" bench --allow-run --allow-env --seed=250 benchmarks | ||
done |
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,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
# this is only available when using pkgx's deno | ||
DENORT_BIN="$(dirname "$(which deno)")/denort" | ||
|
||
if [[ -f "$DENORT_BIN" ]]; then | ||
export DENORT_BIN | ||
else | ||
unset DENORT_BIN | ||
fi | ||
|
||
exec deno compile --lock=deno.lock --allow-read --allow-write --allow-net \ | ||
--allow-run --allow-env --allow-ffi --unstable-ffi --unstable-fs \ | ||
--output "$INIT_CWD/pkgx" ./entrypoint.ts |
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
File renamed without changes.