Giter Site home page Giter Site logo

wasm-n-body's Introduction

N-body system

A WASM workbench for the n-body scenario.

Requirements

Instructions

First, install the development dependencies:

$> npm install

Now, to build assembly/index.ts to an untouched and an optimized .wasm including their respective .wat representations, run:

You will need emscripten installed on your machine (for C โ†’ WASM)

$> npm run build

To run the benchmark:

$> npm run test

To run the native test benchmark (optimized C agains nodejs)

$> npm run testnative

To run the browser test benchmark

$> npm run browserbuild
$> npx serve

Open the browser and point it to localhost:5000

Benchmark

Environment:

  • MacBook Pro (Retina, 13-inch, Late 2017)
  • macOS 10.13.6
  • node.js v10.15.1
  • rustc 1.33.0-beta.10

Results: 1000 steps, 1000 bodies, 2D

COLD SERIES:

Performing 1000 steps (AssemblyScript WASM) ...
Took 2932.2897430000003ms
Performing 1000 steps (AssemblyScript ASMJS) ...
Took 3862.352643ms
Performing 1000 steps (JS) ...
Took 2912.77102ms
Performing 1000 steps (Rust WASM) ...
Took 3096.005317ms

WARMED UP SERIES:

Performing 1000 steps (AssemblyScript WASM) ...
Took 3037.334141ms
Performing 1000 steps (AssemblyScript ASMJS) ...
Took 4032.277231ms
Performing 1000 steps (JS) ...
Took 3043.310233ms
Performing 1000 steps (Rust WASM) ...
Took 3340.9384410000002ms

* unminified

Wants to experiment stuff?

Wants to test that new shiny SIMD support in WASM? We got you covered: install the required tools and follow the instructions in ./C/build.sh to enable it.

Wants to try out this benchmarks? Cool, try them out and let us know the numbers!

wasm-n-body's People

Contributors

w8r avatar dej611 avatar maxgraey avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.