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

Unified Diff: runtime/bin/socket_patch.dart

Issue 208653012: Only return eventhandler tokens in stacks of 8, to avoid runtime calls. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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
« no previous file with comments | « runtime/bin/eventhandler_macos.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket_patch.dart
diff --git a/runtime/bin/socket_patch.dart b/runtime/bin/socket_patch.dart
index 0e7abdb4bf98b0f310f54bf90f848b97838de460..d3ccf0f57334b8665ebec4a1b109579df7d20877 100644
--- a/runtime/bin/socket_patch.dart
+++ b/runtime/bin/socket_patch.dart
@@ -410,6 +410,8 @@ class _NativeSocket extends NativeFieldWrapperClass1 {
int available = 0;
+ int returnTokens = 0;
+
bool sendReadEvents = false;
bool readEventIssued = false;
@@ -818,8 +820,13 @@ class _NativeSocket extends NativeFieldWrapperClass1 {
}
}
}
- if (eventPort != null && !isClosing && !isClosed) {
- sendToEventHandler(1 << RETURN_TOKEN_COMMAND);
+ if (eventPort != null && !isClosing && !isClosed && !isListening) {
+ returnTokens++;
+ if (returnTokens == 8) {
+ // Return in batches of 8.
Søren Gjesse 2014/03/25 13:31:22 assert(1 << FIRST_COMMAND < returnTokens)
Anders Johnsen 2014/03/25 13:43:35 Done.
+ sendToEventHandler((1 << RETURN_TOKEN_COMMAND) | returnTokens);
+ returnTokens = 0;
+ }
}
}
« no previous file with comments | « runtime/bin/eventhandler_macos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698