Skip to content
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
5 changes: 5 additions & 0 deletions frameworks/keyed/sledgehammer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
/target
/pkg
/wasm-pack.log
/yarn-error.log
29 changes: 29 additions & 0 deletions frameworks/keyed/sledgehammer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[package]
name = "sledgehammer-benchmark"
version = "0.2.0"
edition = "2021"

[dependencies]
sledgehammer = "0.2.0"
wasm-bindgen = "0.2"
js-sys = "0.3"

[dependencies.web-sys]
version = "0.3"
features = [
'Document',
'DomTokenList',
'Element',
'Event',
'EventTarget',
'HtmlElement',
'Node',
'Window',
'console',
]

[profile.release]
lto = true
codegen-units = 1
panic = "abort"
opt-level = 3
14 changes: 14 additions & 0 deletions frameworks/keyed/sledgehammer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Because of the heavy amount of Rust dependencies, this example is pre-compiled, so you don't need to compile anything.

However, if you do want to compile it, you will need the following:

* [Rust](https://www.rust-lang.org/tools/install)

* [truk](https://trunkrs.dev/)

After installing those, run these commands:

```
npm install
npm run build-prod-force
```
55 changes: 55 additions & 0 deletions frameworks/keyed/sledgehammer/bundled-dist/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<!DOCTYPE html><html lang="en"><head>
<meta charset="UTF-8">
<title>sledgehammer-"keyed"</title>
<link href="/css/currentStyle.css" rel="stylesheet">
<!-- <link data-trunk rel="rust" data-wasm-opt="0" /> -->
<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>

<link rel="preload" href="/frameworks/keyed/sledgehammer/bundled-dist/sledgehammer-benchmark_bg.wasm" as="fetch" type="application/wasm" crossorigin="">
<link rel="modulepreload" href="/frameworks/keyed/sledgehammer/bundled-dist/sledgehammer-benchmark.js"></head>

<body>
<div id="main">
<div class="container">
<div class="jumbotron">
<div class="row">
<div class="col-md-6">
<h1>sledgehammer-"keyed"</h1>
</div>
<div class="col-md-6">
<div class="row">
<div class="col-sm-6 smallpad">
<button type="button" class="btn btn-primary btn-block" id="run">Create 1,000
rows</button>
</div>
<div class="col-sm-6 smallpad">
<button type="button" class="btn btn-primary btn-block" id="runlots">Create 10,000
rows</button>
</div>
<div class="col-sm-6 smallpad">
<button type="button" class="btn btn-primary btn-block" id="add">Append 1,000
rows</button>
</div>
<div class="col-sm-6 smallpad">
<button type="button" class="btn btn-primary btn-block" id="update">Update every 10th
row</button>
</div>
<div class="col-sm-6 smallpad">
<button type="button" class="btn btn-primary btn-block" id="clear">Clear</button>
</div>
<div class="col-sm-6 smallpad">
<button type="button" class="btn btn-primary btn-block" id="swaprows">Swap Rows</button>
</div>
</div>
</div>
</div>
</div>
<table class="table table-hover table-striped test-data">
<tbody id="tbody"></tbody>
</table>
<span class="preloadicon glyphicon glyphicon-remove" aria-hidden="true"></span>
</div>
</div>


</body></html>
Loading