Closed
Description
The following function is roughly 3x slower for me compared to regular js for large values. Am I doing something wrong or is there something I can do to speed it up? Any kind of help is appreciated!
function map_page_rank(pages: Array<Int32Array>, page_ranks: Float64Array, maps: Array<Float64Array>, noutlinks: Int32Array, n: i32): void {
const t1 = performanceNow();
for (let i=0; i < n; ++i) {
const outbound_rank = unchecked(page_ranks[i])/unchecked(noutlinks[i]);
for(let j=0; j < n; ++j) {
if (unchecked(pages[i][j]) === 0) {
unchecked(maps[i][j] = 0);
} else {
unchecked(maps[i][j] = unchecked(pages[i][j])*outbound_rank);
}
}
}
const t2 = performanceNow();
consoleLog(((t2 - t1)/1000).toString());
}
Metadata
Metadata
Assignees
Labels
No labels