From 5050c8c023a0b7763a2c5136b55405d2dd5f6b67 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Fri, 23 Jan 2015 20:46:59 +0000 Subject: [PATCH] optimise common case for highlights (triggered on mousemove) --- .../aceEditor/highlights/HighlightsManager.coffee | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor/highlights/HighlightsManager.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor/highlights/HighlightsManager.coffee index 6173e053f7..d1f520d8f1 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor/highlights/HighlightsManager.coffee +++ b/services/web/public/coffee/ide/editor/directives/aceEditor/highlights/HighlightsManager.coffee @@ -106,8 +106,11 @@ define [ labelToShow = label if !labelToShow? - @$scope.$apply () => - @$scope.annotationLabel.show = false + # this is the most common path, triggered on mousemove, so + # for performance only apply setting when it changes + if @$scope?.annotationLabel?.show != false + @$scope.$apply () => + @$scope.annotationLabel.show = false else $ace = $(@editor.renderer.container).find(".ace_scroller") # Move the label into the Ace content area so that offsets and positions are easy to calculate.