+
Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
benchmark/node_modules
benchmark/target
17 changes: 17 additions & 0 deletions Dockerfile.benchmark
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM rust:1.69.0
WORKDIR /usr/src/

# https://github.com/nodesource/distributions
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -y nodejs
RUN cargo install hyperfine

COPY Cargo.toml Cargo.lock ./
COPY ./crates ./crates
COPY ./xtask ./xtask

WORKDIR /usr/src/benchmark

COPY ./benchmark .

RUN npm ci
RUN node run.js
8 changes: 7 additions & 1 deletion benchmark/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Benchmarks
## Getting Started
## Running in Docker

Run in the root directory, not `./benchmark`

1. `docker build --rm -f Dockerfile.benchmark . --progress plain`

## Running locally
1. Install hyperfine: `cargo install hyperfine`
2. Install node modules: `npm i`
3. Run the benchmarks: `node run.js`
Expand Down
2 changes: 1 addition & 1 deletion benchmark/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ function cloneProject(name, repository, dirs = []) {
console.log(`Updating git repository in directory ${projectDirectory}`);
inProjectDirectory.run("git reset --hard @{u}");
inProjectDirectory.run("git clean -df");
inProjectDirectory.run("git pull --depth=1");
inProjectDirectory.run("git pull --depth=1 --ff-only");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was needed as the rust image used did not have any configuration set for how to merge when pulling, so it would fail.

} else {
console.log("Clone project...");

Expand Down
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载