Code Monkey home page Code Monkey logo

webgl-matrix-benchmarks's Introduction

Simple benchmarks for testing the speed of JavaScript matrix libraries adapted from Brandon Jones benchmarks in his glmatrix library: https://glmatrix.googlecode.com/hg/

If you have a browser with WebGL you can run the benchmarks here.

This work is based on Brandon's work as of this commit:

e5ad8f6975eef038de668914a44ed36e2c611966
Date:	October 10, 2010 12:49:00 PM EDT
Upped version to 0.9.5

Comparing these matrix libraries:

Changes from Brandon's original benchmark code include:

  • Only including the benchmark code from glmatrix.
  • Updated to the latest mjs as of Dec 15: 16:8e5b0944ef1e and included it in several more tests.
  • Added a graph display of the results using flotr, see: http://solutoire.com/flotr/
  • Added tdl library (thanks to Gregg Tavares)
  • each library runs in an iframe so the code won't affect the other libraries (thanks to Gregg Tavares)
  • Added Sylvester library (thanks to Felix E. Klee)

Brandon's original code was released under the New BSD license. My additions to the benchmarking code are released under the same license.

Running locally requires a web server.

With the recent changes by Gregg Tavares that run each library in an iFrame you will need to either:

  • Run the benchmarks from a local web server
  • Configure the browser to allow local file access

Configuring Chrome to allow local file access

On Windows you can add a flag in the shortcut.

On Mac OS X start Chrome from the command line like this:

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --allow-file-access-from-files

Using Python's SimpleHTTPServer

cd /path/to/webgl-matrix-benchmarks
python -m SimpleHTTPServer

Now open: http://localhost:8000/matrix_benchmark.html

Set up an webgl-matrix-benchmarks.local local host and Apache vhost on Mac OS X

On OS X, turn on Web Sharing via (Apple Menu) -> System Preferences -> Sharing -> Web Sharing

Now, make sure that virtual hosting is enabled by editing /private/etc/apache2/httpd.conf and uncommenting the virtual hosting line (at about line 465 of the stock httpd.conf) as follows:

# Virtual hosts
Include /private/etc/apache2/extra/httpd-vhosts.conf

At the top of httpd-vhosts.conf enable name-based virtual hosts for port 80 on all interfaces:

NameVirtualHost *:80

Edit the virtual hosting configuration file /private/etc/apache2/extra/httpd-vhosts.conf to include the entry:

<VirtualHost webgl-matrix-benchmarks.local:80>
   ServerName webgl-matrix-benchmarks
   DocumentRoot /path/to/webgl-matrix-benchmarks
   PassengerEnabled off
   <Directory /path/to/webgl-matrix-benchmarks >
     Options +Indexes +FollowSymLinks +MultiViews +Includes
     AllowOverride All
     Order allow,deny
     Allow from all
     DirectoryIndex matrix_benchmark.html
  </Directory>
</VirtualHost>

after making changes test the config: apachectl configtest

When the configuration syntax is correct restart apache: sudo apachectl restart

If there are issues try tailing the general apache2 error log: tail -n 200 -f /var/log/apache2/error_log

For more instructions, set http://shapeshed.com/journal/setting_up_local_websites_on_snow_leopard/.

And, finally, edit your /etc/hosts file to include the following line:

127.0.0.1       webgl-matrix-benchmarks.local

Confirm that the new entry works:

$ dscacheutil -q host -a name webgl-matrix-benchmarks.local
name: webgl-matrix-benchmarks.local
ip_address: 127.0.0.1

It might be necessary to flush the local DNS cache:

$ sudo dscacheutil -flushcache

Now open: http://webgl-matrix-benchmarks.local/

webgl-matrix-benchmarks's People

Contributors

feklee avatar gero3 avatar greggman avatar rehno-lindeque avatar stepheneb 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.