Hi all.

Not everyone on this newsgroup reads dev.platform, so I wanted to
summarize a discussion we recently had there for this audience.

Essentially, gecko in B2G uses a lot of memory for its JS components.
About half of this is due to four workers (RIL, Net, WiFi * 2), and
the rest is spread out among various bits of Gecko:
BrowserElementParent.jsm, Webapps.js, and hundreds of other files.

If we're going to continue targeting 256mb devices, where we have
~120mb available for all Gecko processes, I argued that we need to
improve this situation.  We also need to not make the situation worse.

The main impact of this on you is that before you implement a new
feature, please stop and consider whether you can write in C++; in
general, a C++ implementation will use far less memory than an
equivalent JS implementation.  Please be particularly wary of adding
new worker threads; these are very expensive.

If you're not sure whether you ought to write your feature in JS or
C++, it might be worth talking with a DOM peer.

To emphasize: We haven't outlawed writing new features in JS; the
consensus was simply that JS should not be the default.

If you want to read the whole thread, it's on Google Groups.  I
summarized our conclusions in [1], and the initial post is [2].

Happy hacking,
-Justin

[1] 
https://groups.google.com/d/msg/mozilla.dev.platform/XMkcvEAeA60/BOTx1d-1y8gJ
[2] 
https://groups.google.com/d/msg/mozilla.dev.platform/XMkcvEAeA60/bNKVZdrRcn4J
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to