Closed Bug 1364559 Opened 5 years ago Closed 27 days ago

Consider extending SharedImmutableStringsCache to work between processes

Categories

(Core :: JavaScript Engine, enhancement, P3)

enhancement

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: mccr8, Unassigned)

References

Details

(Keywords: triage-deferred, Whiteboard: [MemShrink:P2][overhead:500k])

SharedImmutableStringsCache is used to share immutable strings, namely copies of source code, between JS runtimes in a process. I dumped out the hashes of the strings in the different processes, and I'd estimate there's about 500kb of strings in common between different processes. It would make sense that source for the various frame scripts and jsms end up in common between different processes. Potentially we could reduce the overhead of this by using shared memory. A content process would send a potential string to the parent, which could then add it into some shared memory buffer that the child is only allowed to read. Maybe we'd only want to do this for chrome scripts to reduce possible security issues for cross origin information leaks.
Seems like this work could be a good start for sharing other parts of JS across processes as well.
Whiteboard: [MemShrink] → [MemShrink:P1]
Blocks: 1353816
Keywords: triage-deferred
Priority: -- → P3
Whiteboard: [MemShrink:P1] → [MemShrink:P1][overhead:500k]
In bug 1463587, I'm adding a helper to allow us to create snapshots of shared memory in the parent process, remap them as read-only, and then share them among child processes. That may be helpful here.
Whiteboard: [MemShrink:P1][overhead:500k] → [MemShrink:P2][overhead:500k]

This was a fairly vague idea, so I'm just going to close it. If somebody has a more concrete plan in mind, a new bug is probably in order.

Status: NEW → RESOLVED
Closed: 27 days ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.