Skip to content

Commit

Permalink
[SPARK-21254][WebUI] Performance optimization for pagination check
Browse files Browse the repository at this point in the history
Check whether to display pagination or not on large data sets (10-20k rows)
was taking up to 50ms because it was iterating over all rows. This could be
easily done by testing length of array before passing it to mustache.
  • Loading branch information
2ooom committed Jul 31, 2017
1 parent 114943b commit 332b398
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ $(document).ready(function() {
array.push(app_clone);
}
}
if(array.length < 20) {
$.fn.dataTable.defaults.paging = false;
}

var data = {
"uiroot": uiRoot,
Expand Down Expand Up @@ -190,11 +193,6 @@ $(document).ready(function() {
}
}
historySummary.append(apps);

if ($(selector.concat(" tr")).length < 20) {
$.extend(conf, {paging: false});
}

$(selector).DataTable(conf);
$('#history-summary [data-toggle="tooltip"]').tooltip();
});
Expand Down

0 comments on commit 332b398

Please sign in to comment.