From f7ccafc34031ca583d4e463decf06a116abfa7ae Mon Sep 17 00:00:00 2001 From: "asiva@google.com" Date: Tue, 3 Jun 2014 21:09:07 +0000 Subject: [PATCH] Use a proper closure instead of a 'close your eyes' style closure for setting up '_printClosure'. This avoid the startup cost of looking up types 'window', 'console' and 'HTMLDocument' types when we try to setup _printClosure. On a nexus 4 device the change results in the following time changes: Before the change: I/Dartium (25903): createIsolate before printClosure setting 155.318 ms I/Dartium (25903): createIsolate after printClosure setting 403.052 ms After the Change: I/Dartium (26537): createIsolate before printClosure setting 157.058 ms I/Dartium (26537): createIsolate after printClosure setting 162.918 ms R=rmacnak@google.com, vsm@google.com Review URL: https://codereview.chromium.org//312653004 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36943 260f80e4-7a28-3924-810f-c04153c831b5 --- sdk/lib/html/dartium/html_dartium.dart | 2 +- tools/dom/src/html_native_DOMImplementation.dart | 2 +- tools/dom/src/native_DOMImplementation.dart | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart index 2e24837a168..ae546ccaa9e 100644 --- a/sdk/lib/html/dartium/html_dartium.dart +++ b/sdk/lib/html/dartium/html_dartium.dart @@ -37982,7 +37982,7 @@ class _DOMStringMap extends NativeFieldWrapperClass2 implements Map window.console.log(s); final _pureIsolatePrintClosure = (s) { throw new UnimplementedError("Printing from a background isolate " "is not supported in the browser"); diff --git a/tools/dom/src/html_native_DOMImplementation.dart b/tools/dom/src/html_native_DOMImplementation.dart index 28ce6f503a0..d7e087eb510 100644 --- a/tools/dom/src/html_native_DOMImplementation.dart +++ b/tools/dom/src/html_native_DOMImplementation.dart @@ -512,7 +512,7 @@ class _DOMStringMap extends NativeFieldWrapperClass2 implements Map window.console.log(s); final _pureIsolatePrintClosure = (s) { throw new UnimplementedError("Printing from a background isolate " "is not supported in the browser"); diff --git a/tools/dom/src/native_DOMImplementation.dart b/tools/dom/src/native_DOMImplementation.dart index 490dd144851..d8d603b8b18 100644 --- a/tools/dom/src/native_DOMImplementation.dart +++ b/tools/dom/src/native_DOMImplementation.dart @@ -499,7 +499,7 @@ class _DOMStringMap extends NativeFieldWrapperClass2 implements Map window.console.log(s); final _pureIsolatePrintClosure = (s) { throw new UnimplementedError("Printing from a background isolate " "is not supported in the browser");