Closed Bug 962585 Opened 11 years ago Closed 7 years ago

Don't use require.js in ril_worker.js and nfc_worker.js

Categories

(Firefox OS Graveyard :: RIL, defect, P2)

ARM
Gonk (Firefox OS)
defect

Tracking

(blocking-b2g:-)

RESOLVED WONTFIX
blocking-b2g -

People

(Reporter: bkelly, Unassigned)

References

Details

(Keywords: perf, Whiteboard: [c=memory p= s= u=][MemShrink:P3])

Attachments

(1 file)

The ril_worker.js uses about 3x the memory net_worker.js uses on my device:

├───3.82 MB (10.24%) -- workers/workers()
│   ├──2.85 MB (07.66%) ++ worker(resource://gre/modules/ril_worker.js, 0x443a6c00)
│   └──0.96 MB (02.58%) ++ worker(resource://gre/modules/net_worker.js, 0x443a7400)

Its possible this difference is due to a larger workload for ril_worker.js, but perhaps there are optimizations we could make here.

For example, can we gain some memory back by not loading require.js and importing other modules directly, etc.
Note that the ril worker is a massive amount of code. Almost 1MB is due to script-sources, and that should go down once bug 944659 lands.
Attached patch ril-no-require.patch (deleted) — Splinter Review
This patch implements Ben's idea of not using require.js to load worker_buf.js
The memory saving is modest (about 60k per worker).
Priority: -- → P2
Do we have any ideas for optimizations that are specific to ril_worker.js? If not, I think we should just dup this bug against bug 864927.
There's the simple patch I attached there that is ril-worker specific. Not a huge gain, but still a little something.
If that's it, the title should be updated accordingly. Thanks!
(In reply to Fabrice Desré [:fabrice] from comment #4)
> There's the simple patch I attached there that is ril-worker specific. Not a
> huge gain, but still a little something.

We can integrate worker_buf.js back to ril_worker again once bug 933588, rewrite nfc_worker with C++, is merged.
(In reply to Vicamo Yang [:vicamo][:vyang] from comment #6)
> (In reply to Fabrice Desré [:fabrice] from comment #4)
> > There's the simple patch I attached there that is ril-worker specific. Not a
> > huge gain, but still a little something.
> 
> We can integrate worker_buf.js back to ril_worker again once bug 933588,
> rewrite nfc_worker with C++, is merged.

Absolutely Vicamo, but I'd rather not wait for that. I'll update the patch to also fix the nfc worker.
Summary: improve ril_worker.js memory usage → Don't use require.js in ril_worker.js and nfc_worker.js
Well I had other ideas to investigate, but I guess I'll just write new bugs if they pan out.
mark 1.3T?
blocking-b2g: --- → 1.3T?
Whiteboard: [c=memory p= s= u=tarako][MemShrink][tarako] → [c=memory p= s= u=tarako][MemShrink]
triage: saving is small. not block tarako on this
blocking-b2g: 1.3T? → -
Whiteboard: [c=memory p= s= u=tarako][MemShrink] → [c=memory p= s= u=][MemShrink]
Fabrice, should you request review on the patch?
Whiteboard: [c=memory p= s= u=][MemShrink] → [c=memory p= s= u=][MemShrink:P3]
(In reply to Nicholas Nethercote [:njn] from comment #11)
> Fabrice, should you request review on the patch?

I need to rebase after the big RIL worker refactoring from bug 960894 first.
Blocks: b2g-NFC-2.0
No longer blocks: b2g-NFC-2.0
Closing out old Firefox OS specific memshrink bugs.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: