Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Unified Diff: runtime/vm/service/vmservice.dart

Issue 533073005: Reduce service isolate startup time from ~80ms to ~30ms (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« runtime/vm/service.cc ('K') | « runtime/vm/service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service/vmservice.dart
diff --git a/runtime/vm/service/vmservice.dart b/runtime/vm/service/vmservice.dart
index 3f53dbeb4c2a64add2bd93269daf78dde3e52fff..10e73c9b88257fb84aa423bb31a6656b2347cfdd 100644
--- a/runtime/vm/service/vmservice.dart
+++ b/runtime/vm/service/vmservice.dart
@@ -16,6 +16,9 @@ part 'running_isolates.dart';
part 'message.dart';
part 'message_router.dart';
+final RawReceivePort isolateLifecyclePort = new RawReceivePort();
+final RawReceivePort scriptLoadPort = new RawReceivePort();
+
class VMService extends MessageRouter {
static VMService _instance;
/// Collection of currently connected clients.
@@ -104,13 +107,14 @@ class VMService extends MessageRouter {
}
VMService._internal()
- : eventPort = new RawReceivePort() {
+ : eventPort = isolateLifecyclePort {
eventPort.handler = messageHandler;
}
factory VMService() {
if (VMService._instance == null) {
VMService._instance = new VMService._internal();
+ _onStart();
}
return _instance;
}
@@ -142,9 +146,8 @@ class VMService extends MessageRouter {
}
RawReceivePort boot() {
- // Boot the VMService.
// Return the port we expect isolate startup and shutdown messages on.
- return new VMService().eventPort;
+ return isolateLifecyclePort;
}
void _registerIsolate(int port_id, SendPort sp, String name) {
@@ -154,3 +157,5 @@ void _registerIsolate(int port_id, SendPort sp, String name) {
void _setEventMask(int mask)
native "VMService_SetEventMask";
+
+void _onStart() native "VMService_OnStart";
« runtime/vm/service.cc ('K') | « runtime/vm/service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698