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
This commit is contained in:
@@ -37982,7 +37982,7 @@ class _DOMStringMap extends NativeFieldWrapperClass2 implements Map<String, Stri
|
||||
}
|
||||
}
|
||||
|
||||
final _printClosure = window.console.log;
|
||||
final _printClosure = (s) => window.console.log(s);
|
||||
final _pureIsolatePrintClosure = (s) {
|
||||
throw new UnimplementedError("Printing from a background isolate "
|
||||
"is not supported in the browser");
|
||||
|
||||
@@ -512,7 +512,7 @@ class _DOMStringMap extends NativeFieldWrapperClass2 implements Map<String, Stri
|
||||
}
|
||||
}
|
||||
|
||||
final _printClosure = window.console.log;
|
||||
final _printClosure = (s) => window.console.log(s);
|
||||
final _pureIsolatePrintClosure = (s) {
|
||||
throw new UnimplementedError("Printing from a background isolate "
|
||||
"is not supported in the browser");
|
||||
|
||||
@@ -499,7 +499,7 @@ class _DOMStringMap extends NativeFieldWrapperClass2 implements Map<String, Stri
|
||||
}
|
||||
}
|
||||
|
||||
final _printClosure = window.console.log;
|
||||
final _printClosure = (s) => window.console.log(s);
|
||||
final _pureIsolatePrintClosure = (s) {
|
||||
throw new UnimplementedError("Printing from a background isolate "
|
||||
"is not supported in the browser");
|
||||
|
||||
Reference in New Issue
Block a user