New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 715179 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner: ----
Closed: Nov 15
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 715175



Sign in to add a comment

Mojo in-process optimization idea: lazy serialization.

Project Member Reported by yzshen@chromium.org, Apr 25 2017

Issue description

(The following description was from Ken.)

This would be doable in theory if our message objects supported some mechanism for deferred serialization all the way down to the system layer. That could be an interesting idea to pursue, but I think typemapping leaves us in an awkward place.

A nice feature of typemaps is that they write directly from some source data into a message buffer. This means that even for non-movable objects, only a single minimal copy happens on send. If we used deferred serialization, we'd have to capture an intermediate copy of these objects at send-time anyway, much like Bind does.

Of course if this were combined with scatter-gather I/O, we could just always serialize non-movable types into their own buffer right away and thus get the best of both worlds, paying serialization cost for only these types in the intraprocess case. Alternatively we could just generate code to do full upfront serialization for any message with an argument that's neither movable nor trivially copyable.

In any case, while deferred serialization would make the low-level message object API just that much more awkward to use, it wouldn't require a very complex implementation.
 
Cc: -roc...@chromium.org rockot@google.com
Status: Fixed (was: Untriaged)
Guess we had a separate bug to track this work and this one got lost. Lazy serialization is done.

For posterity, we avoid the issue of redundant copies by also observing the likely remoteness of the peer endpoint. When we're pretty sure the peer is in a remote process, we do eager serialization right away.

Sign in to add a comment