Code Monkey home page Code Monkey logo

particle-system's Introduction

Particle System

Description

A Particle System experiment designed to benchmark web technologies from a non trivial piece of code: ES6, Emscripten and Web Assembly

Setup/Usage Instructions

  • Building the ASM.js and WebAssembly versions:

If you want to build the Web Assembly version, you need to build the Emscripten toolchain from source using the incoming branch. The master branch does NOT support BINARYEN=1 option at the moment

 [Install Emscripten Portable SDK](https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html#all-os-installation-instructions-portable-sdk)
 
 [Building Emscripten from Source](https://kripken.github.io/emscripten-site/docs/building_from_source/index.html?highlight=build%20from%20source)
 
  . cd particle-system/Emscriptem
  . make
  . emcc -s NO_EXIT_RUNTIME=1 -s release/ParticleSystem.bc --post-js ParticleSystem/glue.js -o dist/asmjs/ParticleSystem.asm.js
  (or run emcc-asmjs.sh script for mac/linux users. Assumes emcc is in your PATH)
  . eemcc -s NO_EXIT_RUNTIME=1 -s BINARYEN=1 release/ParticleSystem.bc --post-js ParticleSystem/glue.js -o dist/wasm/ParticleSystem.js
  (or run emcc-wasm.sh script for mac/linux users. Assumes emcc is in your PATH)
  • Building the the ES6 Particle System Library and the Test pages:

      . npm install
      . npm run build-lib-dev / npm run build-lib-prod
      (prod version is minified and without source map)
      . npm run build-tests
    
  • Running the tests:

    Serve Test/. with the HTTP server of your choice ...

If you want to test Web Assembly versions, you need a browser that supports Web Assembly.

At the moment Chrome Canary, Firefox Nighly and soon in Microsoft Edge.

Slides

Boost your Web Application with C++

Live Tests

Performance Tests:

Autodesk Forge Viewer Test:

Three.js Tests:

I've been testing against the following browsers: Chrome, Chrome Canary, Firefox, Firefox Nightly and Safari. Only Canary and Firefox Nightly supports WASM, so the following benchmark only indicate those. Running WASM in a browser that doesn't support it is using a fallback which ends up being very very slow ...

Benchmark results

License

This sample is licensed under the terms of the MIT License. Please see the LICENSE file for full details.

##Written by

Written by Philippe Leefsma

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.