On 28/08/2014 01:56, Jonas Sicking wrote:
> I got the impression that the problem was "application is blocked for
> N ms", which seems like a fixable implementation bug.

Indeed and besides we've always got the option to easily turn off
logging at runtime in JS code (like DUMP() does for instance) so I think
we can live with some limited slow-down only when logging is enabled.
Having the ability to turn it on on a non-debug build dwarfs the
downsides IMHO.

> I don't think sending the data to the parent process is a problem. As
> long as we don't synchronously block while that IPC is happening.
> Simply sending the data asynchronously and then immediately return to
> the calling JS should mean that the IPC is causing no problem.

IPC is quite expensive in general on our implementation so even when
it's non-blocking it does have a measurable performance impact on
single-core devices. Bug 915733 [1] contains more information on this.

> If we want to do anything useful with the data it most likely needs to
> go to the parent process anyway. Child processes never have permission
> to directly write to files, and of course any UI that lives outside of
> the application is handled by other processes, which means that it has
> to at least go through the main process.

That doesn't need to be necessarily true; I remember a suggestion (from
Dave Hylands IIRC) that in a lot of cases we can delegate opening a file
(and the relevant permission checks) to the main process but then have
the file descriptor handed over to the child process for
reading/writing. This preserves our security model but removes most of
the overhead associated with IPC. I can't remember on which bug that
comment was made but it must have been related to bug 896810 [2]. As far
as logging goes this sounds like a workable solution for speeding up
logging in child processes.

Dave, I'm I remembering correctly or is my tired mind making things up?

 Gabriele

[1] Use Linux AIO instead of IO threads for IPC
    https://bugzilla.mozilla.org/show_bug.cgi?id=915733
[2] (move-apis-to-child) Move more implementations out of parent process
    https://bugzilla.mozilla.org/show_bug.cgi?id=896810

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to