# Comparison Matrix and Vector library

## JavaScript performance comparison

Revision 4 of this test case created by indus

## Preparation code

``<script src="https://raw.github.com/mrdoob/three.js/master/build/three.js"></script><script src="https://raw.github.com/1Pupik1989/N3D/master/source/N3D.min.js"></script><script>  N3D.require("Math.Matrix4", "Math.Vector4");</script><script src="https://raw.github.com/sloisel/numeric/master/src/numeric.js"></script>``

## Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
N3D
``var v = new \$V4(1, 2, 3, 1);var m = new \$M4(1, 2, 3, 4, 0, 5, 6, 7, 0, 0, 8, 9, 0, 0, 0, 10);m.inverse();m.multiply(m);v.add(v);m.multiplyVector4(v);``
pending…
Three.js
``var v = new THREE.Vector4(1, 2, 3, 1);var m = new THREE.Matrix4(1, 2, 3, 4, 0, 5, 6, 7, 0, 0, 8, 9, 0, 0, 0, 10);m.getInverse(m);m.multiply(m, m);v.add(v);m.multiplyVector4(v);``
pending…
numericjs
``var v = [1, 2, 3, 1];var m = [  [1, 2, 3, 4],  [0, 5, 6, 7],  [0, 0, 8, 9],  [0, 0, 0, 10]];m = numeric.inv(m);m = numeric.mul(m, m);v = numeric.add(v);m = numeric.mul(v);``
pending…

## Revisions

You can edit these tests or add even more tests to this page by appending `/edit` to the URL. Here’s a list of current revisions for this page: