-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
Description
When running some simple benchmarks of mathjs:
node benchmark/matrix_operations.js
You see output like:
matrix operations mathjs A+A x 85,375 ops/sec ±1.83% (89 runs sampled)
matrix operations mathjs A*A x 2,843 ops/sec ±0.15% (96 runs sampled)
matrix operations mathjs A' x 79,028 ops/sec ±1.73% (91 runs sampled)
matrix operations mathjs det(A) x 105 ops/sec ±0.21% (75 runs sampled)
matrix operations sylvester A+A x 69,318 ops/sec ±1.17% (92 runs sampled)
matrix operations sylvester A*A x 5,659 ops/sec ±0.21% (96 runs sampled)
matrix operations sylvester A' x 113,950 ops/sec ±1.79% (85 runs sampled)
matrix operations sylvester det(A) x 9,778 ops/sec ±1.28% (88 runs sampled)
matrix operations numericjs A+A x 426,161 ops/sec ±1.58% (81 runs sampled)
matrix operations numericjs A*A x 33,622 ops/sec ±0.33% (95 runs sampled)
matrix operations numericjs A' x 528,647 ops/sec ±1.30% (91 runs sampled)
matrix operations numericjs det(A) x 81,438 ops/sec ±0.54% (89 runs sampled)
matrix operations ndarray A+A x 342,996 ops/sec ±1.03% (92 runs sampled)
matrix operations ndarray A*A x 25,012 ops/sec ±0.52% (91 runs sampled)
matrix operations ndarray A' x 390,326 ops/sec ±1.68% (85 runs sampled)
matrix operations ndarray det(A) x 400,209 ops/sec ±0.44% (95 runs sampled)
math.js is slower than other alternatives (up to 1 order of magnitude). This is probably caused by math.js dealing with mixed types rather than just numbers, and there is room for improvement there, but that's for an other topic.
There is one extreme outlier above: calculating the determinant det(A) which is really hundreds of times slower than other math libraries.
Who is interested in diving into this performance issue and try to improve the performance of the determinant?