]> source.dussan.org Git - vaadin-framework.git/commitdiff
Disable slow sanity check when not in debug mode (#12463)
authorHenri Sara <hesara@vaadin.com>
Wed, 28 Aug 2013 07:12:15 +0000 (10:12 +0300)
committerVaadin Code Review <review@vaadin.com>
Wed, 28 Aug 2013 09:13:59 +0000 (09:13 +0000)
Change-Id: I98d0a3254a92bce728d56a591914e727f5ef3aa8

client/src/com/vaadin/client/ApplicationConnection.java

index dc3378560e9804324242403ad5aede9d6c86bb1d..0d9c859ee88d8807e8c81ab222763d6e17196f50 100644 (file)
@@ -1686,8 +1686,15 @@ public class ApplicationConnection {
                 for (int i = 0; i < size; i++) {
                     ServerConnector c = currentConnectors.get(i);
                     if (c.getParent() != null) {
-                        if (!c.getParent().getChildren().contains(c)) {
-                            VConsole.error("ERROR: Connector is connected to a parent but the parent does not contain the connector");
+                        // only do this check if debug mode is active
+                        if (ApplicationConfiguration.isDebugMode()) {
+                            Profiler.enter("unregisterRemovedConnectors check parent - this is only performed in debug mode");
+                            // this is slow for large layouts, 25-30% of total
+                            // time for some operations even on modern browsers
+                            if (!c.getParent().getChildren().contains(c)) {
+                                VConsole.error("ERROR: Connector is connected to a parent but the parent does not contain the connector");
+                            }
+                            Profiler.leave("unregisterRemovedConnectors check parent - this is only performed in debug mode");
                         }
                     } else if (c == getUIConnector()) {
                         // UIConnector for this connection, leave as-is