-
Notifications
You must be signed in to change notification settings - Fork 35
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
1 parent
d1d3e47
commit b784547
Showing
14 changed files
with
996 additions
and
899 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,13 @@ | ||
# TIG Browser Benchmarker | ||
|
||
This browser benchmarker is deployed to https://play.tig.foundation/benchmarker | ||
|
||
To run it locally, run the following commands before visiting localhost in your browser: | ||
|
||
``` | ||
# uncomment below to install wasm-pack | ||
# curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | ||
cd tig-benchmarker | ||
wasm-pack build --release --target web | ||
python3 -m http.server 80 | ||
``` |
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,20 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>TIG Benchmarker Test</title> | ||
</head> | ||
<body> | ||
<h1>TIG Browser Benchmarker</h1> | ||
<h2>Instructions:</h2> | ||
<ol> | ||
<li>Open the browser console</li> | ||
<li>Setup: `await benchmarker.setup(<api_url>, <api_key>, <player_id>)`</li> | ||
<li>Start: `await benchmarker.start(<num_workers>)`</li> | ||
<li>Stop: `await benchmarker.stop()`</li> | ||
<li>Select Algorithm: `await benchmarker.select_algorithm(<challenge_id>, <algorithm_id>)`</li> | ||
<li>View State: `await benchmarker.state()`</li> | ||
</ol> | ||
<script type="module" src="./index.js"></script> | ||
</body> | ||
</html> |
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,12 @@ | ||
import init, { setup, state, start, stop, select_algorithm } from './pkg/tig_benchmarker.js'; | ||
|
||
async function loadWasm() { | ||
console.log("Loading Benchmarker WASM"); | ||
await init("./pkg/tig_benchmarker_bg.wasm"); | ||
window.benchmarker = { | ||
setup, state, start, stop, select_algorithm | ||
}; | ||
console.log("Benchmarker WASM initialized and functions are available globally"); | ||
} | ||
|
||
loadWasm(); |
Oops, something went wrong.