Skip to content

Commit 82ae40c

Browse files
committed
add sledgehammer
1 parent 4886a65 commit 82ae40c

File tree

13 files changed

+1072
-0
lines changed

13 files changed

+1072
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
/target
3+
/pkg
4+
/wasm-pack.log
5+
/yarn-error.log
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[package]
2+
name = "sledgehammer-benchmark"
3+
version = "0.2.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
sledgehammer = "0.2.0"
8+
wasm-bindgen = "0.2"
9+
js-sys = "0.3"
10+
11+
[dependencies.web-sys]
12+
version = "0.3"
13+
features = [
14+
'Document',
15+
'DomTokenList',
16+
'Element',
17+
'Event',
18+
'EventTarget',
19+
'HtmlElement',
20+
'Node',
21+
'Window',
22+
'console',
23+
]
24+
25+
[profile.release]
26+
lto = true
27+
codegen-units = 1
28+
panic = "abort"
29+
opt-level = 3
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Because of the heavy amount of Rust dependencies, this example is pre-compiled, so you don't need to compile anything.
2+
3+
However, if you do want to compile it, you will need the following:
4+
5+
* [Rust](https://www.rust-lang.org/tools/install)
6+
7+
* [truk](https://trunkrs.dev/)
8+
9+
After installing those, run these commands:
10+
11+
```
12+
npm install
13+
npm run build-prod-force
14+
```
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<!DOCTYPE html><html lang="en"><head>
2+
<meta charset="UTF-8">
3+
<title>sledgehammer-"keyed"</title>
4+
<link href="/css/currentStyle.css" rel="stylesheet">
5+
<!-- <link data-trunk rel="rust" data-wasm-opt="0" /> -->
6+
<script type="module">import init from '/frameworks/keyed/sledgehammer/bundled-dist/sledgehammer-benchmark.js';init('/frameworks/keyed/sledgehammer/bundled-dist/sledgehammer-benchmark_bg.wasm');</script>
7+
8+
<link rel="preload" href="/frameworks/keyed/sledgehammer/bundled-dist/sledgehammer-benchmark_bg.wasm" as="fetch" type="application/wasm" crossorigin="">
9+
<link rel="modulepreload" href="/frameworks/keyed/sledgehammer/bundled-dist/sledgehammer-benchmark.js"></head>
10+
11+
<body>
12+
<div id="main">
13+
<div class="container">
14+
<div class="jumbotron">
15+
<div class="row">
16+
<div class="col-md-6">
17+
<h1>sledgehammer-"keyed"</h1>
18+
</div>
19+
<div class="col-md-6">
20+
<div class="row">
21+
<div class="col-sm-6 smallpad">
22+
<button type="button" class="btn btn-primary btn-block" id="run">Create 1,000
23+
rows</button>
24+
</div>
25+
<div class="col-sm-6 smallpad">
26+
<button type="button" class="btn btn-primary btn-block" id="runlots">Create 10,000
27+
rows</button>
28+
</div>
29+
<div class="col-sm-6 smallpad">
30+
<button type="button" class="btn btn-primary btn-block" id="add">Append 1,000
31+
rows</button>
32+
</div>
33+
<div class="col-sm-6 smallpad">
34+
<button type="button" class="btn btn-primary btn-block" id="update">Update every 10th
35+
row</button>
36+
</div>
37+
<div class="col-sm-6 smallpad">
38+
<button type="button" class="btn btn-primary btn-block" id="clear">Clear</button>
39+
</div>
40+
<div class="col-sm-6 smallpad">
41+
<button type="button" class="btn btn-primary btn-block" id="swaprows">Swap Rows</button>
42+
</div>
43+
</div>
44+
</div>
45+
</div>
46+
</div>
47+
<table class="table table-hover table-striped test-data">
48+
<tbody id="tbody"></tbody>
49+
</table>
50+
<span class="preloadicon glyphicon glyphicon-remove" aria-hidden="true"></span>
51+
</div>
52+
</div>
53+
54+
55+
</body></html>

0 commit comments

Comments
 (0)