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
12 changes: 6 additions & 6 deletions n-body/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ Benchmark
***Environment:***

- MacBook Pro (15-inch, 2019)
- macOS 12.4.0
- node.js v18.4.0
- rustc 1.42.0-nightly (3a3f4a7cb 2019-12-28)
- macOS 12.5.0
- node.js v18.7.0
- rustc 1.64.0-nightly (0f4bcadb4 2022-07-30)

***Results:***

| Target | Time, ***ms*** | Size, ***KB*** |
|-------------------------|-----------------|----------------|
| **AssemblyScript WASM** | **1599** | **1.8** |
| JavaScript | 11608 | 5* |
| Rust WASM | 1631 | 2 |
| **AssemblyScript WASM** | **1606** | **1.8** |
| JavaScript | 11640 | 5* |
| Rust WASM | 1611 | 2 |

___* unminified___
3 changes: 2 additions & 1 deletion n-body/asconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"options": {
"runtime": "stub",
"importMemory": true,
"initialMemory": 17,
"noExportMemory": true,
"sourceMap": true
},
"targets": {
Expand Down
1 change: 0 additions & 1 deletion n-body/assembly/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const compiled = new WebAssembly.Module(

const imports = {
env: {
memory: new WebAssembly.Memory({ initial: 10 }),
abort: (_, line, column) => {
throw Error("abort called at " + line + ":" + column);
}
Expand Down
Binary file modified n-body/build/as_nbody.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion n-body/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"rsbuild": "cd rust && RUSTFLAGS='-C link-arg=-s' cargo +nightly build --release",
"build": "npm run asbuild && npm run tsbuild && npm run rsbuild",
"start": "npx serve",
"test": "node --no-wasm-bounds-checks --no-wasm-stack-checks --expose-gc tests"
"test": "node --nowasm-bounds-checks --nowasm-stack-checks --noliftoff --expose-gc tests"
},
"devDependencies": {
"assemblyscript": "latest",
Expand Down