-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add benchmark tools #777
Add benchmark tools #777
Conversation
Wow!! Thank you! Review soon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huge contribution! Simply done. Thank you!
A few comments...
github-token: $GITHUB_TOKEN | ||
keep-history: true | ||
on: | ||
branch: master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome
tools/benchmark.py
Outdated
from util import run, run_output, root_path, build_path | ||
|
||
benchmark_types = ["hello", "relative_import"] | ||
benchmark_files = ["tests/002_hello.ts", "tests/003_relative_import.ts"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use a map here:
benchmarks = {
“hello”: [“tests/002.ts”, ”—reload”],
# ...
}
tools/benchmark.py
Outdated
benchmark_files = ["tests/002_hello.ts", "tests/003_relative_import.ts"] | ||
|
||
data_file = "gh-pages/data.json" | ||
benchmark_file = "benchmark.json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Store in the out/
dir? AKA util.build_path()
tools/benchmark.py
Outdated
]) | ||
except: | ||
os.mkdir("gh-pages") | ||
with open("gh-pages/data.json", "w") as f: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use data_file
.
categories: sha1List | ||
} | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌
tools/benchmark.py
Outdated
run(["hyperfine", "--export-json", benchmark_file, "--warmup", "3"] + [ | ||
os.path.join(build_dir, "deno") + " " + file | ||
for file in benchmark_files | ||
]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to be able to specify arguments. Like I want to run the same script with —reload and without.
Ideally add hyperfile to 3rd party and build using gn - but I’m also ok if you add a TODO for now |
.gitignore
Outdated
# RLS generated files | ||
/target/ | ||
# benchmark temp files | ||
/benchmark.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It"s no longer written to root.
tools/benchmark.py
Outdated
("relative_import", ["tests/003_relative_import.ts", | ||
"--reload"])] | ||
|
||
data_file = "gh-pages/data.json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it"s easier if you write this to website/data.json
, so that it"s easy to view locally...
Add a comment to the top
# To view the results locally run ./tools/http_server.py and visit
# http://localhost:4545/website
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to store data at //website/data.json
and then export to //gh-pages/
.
Now the local benchmark result should be visible at http://localhost:4545/website
with ./tools/http_server.py
command!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This reverts commit 3ad48bd.
@kt3k This commit broke CI, we had to revert: 516e1da |
@ry The personal access token need to have Then copy the token and paste it in If (This is an example build of my fork, which successfully deployed to gh-pages. commit logs). |
Bumped versions for 0.287.0 Co-authored-by: bartlomieju <[email protected]>
This PR tries to address #373.
gh-pages
for static hosting of web site, and stores benchmark data in a json file//data.json
in gh-pages branch.//tools/benchmark.py
, which performs benchmarks, downloads gh-pages branch and append data to//gh-pages/data.json
.//website/
directory which contains the frontend resources to show the chart of benchmarked data. (The page usesd3
andc3
for showing the chart.)provider: pages
in deployment of travis. This deploys//gh-pages/
directory togh-pages
branch.$GITHUB_TOKEN
env var set appropriately in travis.The demo is available here, which I tested in my fork.
notes: