Giter VIP home page Giter VIP logo

gpu-js-experiments's Introduction

Description

Experiment to see how fast we can solve Mastermind using Donald Knuth's Five-guess algorithm in JavaScript and gpu.js.

TODO

  • Use web workers to run CPU and GPU modes simultaneously

Timings

In Chrome on my MacBook Pro, typcical timings are roughly:

Mode Run Duration
CPU Any 600ms
GPU First 300ms
GPU Subsequent 60ms

I think the first GPU run has to compile the kernel so it takes longer than subsequent runs. Other than that, it looks like the GPU mode runs about 10 times quicker than the CPU mode.

Browsers

It works fine in Chrome and Firefox on my MacBook Pro. However, it fails in Safari:

Error: argument bit ratio not found
lookupFunctionArgumentBitRatio@http://localhost:8082/bundle.js:7651:22
astMemberExpression@http://localhost:8082/bundle.js:13602:48
astCallExpression@http://localhost:8082/bundle.js:13728:30
astVariableDeclaration@http://localhost:8082/bundle.js:13240:26
astBlockStatement@http://localhost:8082/bundle.js:13166:24
astForStatement@http://localhost:8082/bundle.js:13066:22
astBlockStatement@http://localhost:8082/bundle.js:13166:24
astForStatement@http://localhost:8082/bundle.js:13066:22
astFunction@http://localhost:8082/bundle.js:12576:22
toString@http://localhost:8082/bundle.js:8020:42
traceFunctionCalls@http://localhost:8082/bundle.js:7460:30
traceFunctionCalls@http://localhost:8082/bundle.js:7462:34
getPrototypes@http://localhost:8082/bundle.js:7482:73
getPrototypeString@http://localhost:8082/bundle.js:7474:30
translateSource@http://localhost:8082/bundle.js:15749:63
build@http://localhost:8082/bundle.js:15641:25
run@http://localhost:8082/bundle.js:19167:23
shortcut@http://localhost:8082/bundle.js:19187:21
calculateNewGuess@http://localhost:8082/bundle.js:29592:23
recursiveSolveStep@http://localhost:8082/bundle.js:29422:58
solve@http://localhost:8082/bundle.js:29433:37
mastermindGpu@http://localhost:8082/bundle.js:29602:82
http://localhost:8082/bundle.js:29283:75

Links

gpu-js-experiments's People

Contributors

taylorjg avatar

Watchers

 avatar  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.