Last active
April 17, 2018 01:42
-
-
Save piscisaureus/4afe3a5d2a9b97e57835a8c4d826243c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ones } from "./index"; | |
const t1 = ones([100, 100]); | |
const t2 = ones([100, 100]); | |
let count = 10; | |
let total = 0; | |
const begin = Date.now() / 1000; | |
let end = begin; | |
for (let i = 0; i < 20; i++) { | |
const start = end; | |
for (let i = 0; i < count; i++) { | |
const t3 = t1.matMul(t2); | |
} | |
end = Date.now() / 1000; | |
const elapsed = end - start; | |
const throughput = count / elapsed; | |
console.log( | |
`time: ${elapsed}s count: ${count} throughput: ${throughput}/s`); | |
total += count; | |
count = Math.round(total / (end - begin)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment