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

Issue 11440035: Optimize the message queue for many active ports with few messages. (Closed)

Created:
8 years ago by Mads Ager (google)
Modified:
8 years ago
Reviewers:
Ivan Posva
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Optimize the message queue for many active ports with few messages. The current message queue implementation is very inefficient if you are using many active ports with few messages. This happens when you use 'call' a lot on ports which is currently done in dart:io. This patch does not remove messages from the queue when closing a port. Instead it drops messages for closed ports when it processes them. This dramatically speeds up dart:io benchmarks that enqueue tons of writes on a file output stream. R=iposva@google.com BUG=http://dartbug.com/6911 Committed: https://code.google.com/p/dart/source/detail?r=16388

Patch Set 1 #

Patch Set 2 : Lookup ReceivePort in Dart code #

Total comments: 2

Patch Set 3 : Address comment. #

Patch Set 4 : Moved clearing to MessageQueue destructor #

Total comments: 1

Patch Set 5 : Merge with caching changes. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+163 lines, -166 lines) Patch
M runtime/lib/isolate_patch.dart View 1 2 2 chunks +9 lines, -3 lines 0 comments Download
M runtime/vm/dart_entry.h View 1 2 3 4 1 chunk +5 lines, -1 line 0 comments Download
M runtime/vm/dart_entry.cc View 1 2 3 4 2 chunks +34 lines, -2 lines 0 comments Download
M runtime/vm/isolate.cc View 1 2 2 chunks +16 lines, -1 line 0 comments Download
M runtime/vm/message.h View 1 chunk +2 lines, -2 lines 0 comments Download
M runtime/vm/message.cc View 1 2 3 2 chunks +2 lines, -27 lines 0 comments Download
M runtime/vm/message_handler.cc View 1 3 4 chunks +3 lines, -6 lines 0 comments Download
M runtime/vm/message_handler_test.cc View 8 chunks +81 lines, -48 lines 0 comments Download
M runtime/vm/message_test.cc View 2 chunks +2 lines, -76 lines 0 comments Download
M runtime/vm/object_store.h View 1 2 3 4 2 chunks +8 lines, -0 lines 0 comments Download
M runtime/vm/object_store.cc View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
Mads Ager (google)
8 years ago (2012-12-06 12:14:31 UTC) #1
Mads Ager (google)
ping
8 years ago (2012-12-12 07:40:05 UTC) #2
Ivan Posva
I am not sure that this code properly drains the message queue when the last ...
8 years ago (2012-12-13 02:26:54 UTC) #3
Mads Ager (google)
Thanks for the comments Ivan. I have changed the code to perform the lookup in ...
8 years ago (2012-12-14 13:53:29 UTC) #4
Ivan Posva
Looks much better, but what I am not 100% convinced yet is that we will ...
8 years ago (2012-12-19 07:09:44 UTC) #5
Mads Ager (google)
I agree that there should be a case where we can destruct the message handler ...
8 years ago (2012-12-19 15:47:57 UTC) #6
Mads Ager (google)
Moved the clearing to the MessageQueue destructor as discussed offline. PTAL
8 years ago (2012-12-19 18:36:39 UTC) #7
Ivan Posva
LGTM with comment. -Ivan https://codereview.chromium.org/11440035/diff/13001/runtime/vm/dart_entry.cc File runtime/vm/dart_entry.cc (right): https://codereview.chromium.org/11440035/diff/13001/runtime/vm/dart_entry.cc#newcode321 runtime/vm/dart_entry.cc:321: RawObject* DartLibraryCalls::LookupReceivePort(Dart_Port port_id) { Please ...
8 years ago (2012-12-20 17:19:43 UTC) #8
Mads Ager (google)
8 years ago (2012-12-20 19:14:47 UTC) #9
Thanks Ivan. I'll merge with Florian's caching changes. :-)

Powered by Google App Engine
This is Rietveld 408576698