Skip to content

Commit

Permalink
perf: add transposeViewMul benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
targos committed Aug 21, 2017
1 parent 6318a9c commit 0d24ea9
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions benchmark/transposeViewMul.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
'use strict';

var Suite = require('benchmark').Suite;
var Matrix = require('..').Matrix;

var n = 100;

var A1 = Matrix.rand(n, n);
var A2 = Matrix.rand(n, n);

var suite = new Suite();

suite
.add('transpose mmul', function () {
A1.transpose().mmul(A2);
})
.add('transposeView mmul', function () {
A1.transposeView().mmul(A2);
})
.on('cycle', function (event) {
console.log(String(event.target));
})
.on('complete', function() {
console.log('Fastest is ' + this.filter('fastest').map('name'));
})
.run();

0 comments on commit 0d24ea9

Please sign in to comment.