Skip to content

Commit

Permalink
loosened the tight restraints table imposes to try and ensure smooth …
Browse files Browse the repository at this point in the history
…rendering
  • Loading branch information
Spencer Alger committed Mar 12, 2014
1 parent b4917b7 commit b4a04b3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/kibana/directives/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ define(function (require) {
var timing;

if (
performance
&& rowsPerTick === void 0
rowsPerTick === void 0
&& typeof window.performance === 'object'
&& typeof performance.now === 'function'
) {
timing = performance.now();
Expand All @@ -129,11 +129,12 @@ define(function (require) {
.forEach(forEachRow);

if (timing) {
// we know we have performance.now, because timing was set
var time = performance.now() - timing;
var rowsRendered = rowsPerTick;
var msPerRow = time / rowsPerTick;
// aim to fit the rendering into 5 milliseconds
rowsPerTick = Math.ceil(5 / msPerRow);
rowsPerTick = Math.ceil(15 / msPerRow);
console.log('completed render of %d rows in %d milliseconds. rowsPerTick set to %d', rowsRendered, time, rowsPerTick);
}

Expand Down

0 comments on commit b4a04b3

Please sign in to comment.