Repository: spark Updated Branches: refs/heads/master 297b81e0e -> 25f506e2a
[SPARK-25973][CORE] Spark History Main page performance improvement HistoryPage.scala counts applications (with a predicate depending on if it is displaying incomplete or complete applications) to check if it must display the dataTable. Since it only checks if allAppsSize > 0, we could use exists method on the iterator. This way we stop iterating at the first occurence found. Such a change has been relevant (roughly 12s improvement on page loading) on our cluster that runs tens of thousands of jobs per day. Closes #22982 from Willymontaz/SPARK-25973. Authored-by: William Montaz <w.mon...@criteo.com> Signed-off-by: Sean Owen <sean.o...@databricks.com> Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/25f506e2 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/25f506e2 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/25f506e2 Branch: refs/heads/master Commit: 25f506e2ad865ed671cfc618ca9d272bfb5712b7 Parents: 297b81e Author: William Montaz <w.mon...@criteo.com> Authored: Fri Nov 9 08:02:53 2018 -0600 Committer: Sean Owen <sean.o...@databricks.com> Committed: Fri Nov 9 08:02:53 2018 -0600 ---------------------------------------------------------------------- .../scala/org/apache/spark/deploy/history/HistoryPage.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/25f506e2/core/src/main/scala/org/apache/spark/deploy/history/HistoryPage.scala ---------------------------------------------------------------------- diff --git a/core/src/main/scala/org/apache/spark/deploy/history/HistoryPage.scala b/core/src/main/scala/org/apache/spark/deploy/history/HistoryPage.scala index 32667dd..00ca4ef 100644 --- a/core/src/main/scala/org/apache/spark/deploy/history/HistoryPage.scala +++ b/core/src/main/scala/org/apache/spark/deploy/history/HistoryPage.scala @@ -31,8 +31,8 @@ private[history] class HistoryPage(parent: HistoryServer) extends WebUIPage("") val requestedIncomplete = Option(UIUtils.stripXSS(request.getParameter("showIncomplete"))).getOrElse("false").toBoolean - val allAppsSize = parent.getApplicationList() - .count(isApplicationCompleted(_) != requestedIncomplete) + val displayApplications = parent.getApplicationList() + .exists(isApplicationCompleted(_) != requestedIncomplete) val eventLogsUnderProcessCount = parent.getEventLogsUnderProcess() val lastUpdatedTime = parent.getLastUpdatedTime() val providerConfig = parent.getProviderConfig() @@ -63,9 +63,9 @@ private[history] class HistoryPage(parent: HistoryServer) extends WebUIPage("") } { - if (allAppsSize > 0) { + if (displayApplications) { <script src={UIUtils.prependBaseUri( - request, "/static/dataTables.rowsGroup.js")}></script> ++ + request, "/static/dataTables.rowsGroup.js")}></script> ++ <div id="history-summary" class="row-fluid"></div> ++ <script src={UIUtils.prependBaseUri(request, "/static/historypage.js")}></script> ++ <script>setAppLimit({parent.maxApplications})</script> --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org