At the moment, SessionSaver._writeState does the following: 1. serialize |state| to JSON; 2. notify observers; 3. call SessionFile.write(state). Operations 1., 2. and 3. can be slow. It would, however, considerably alleviate the issue if we could execute them in different ticks.
Marking this as a mentored bug. The code lives here: http://dxr.mozilla.org/mozilla-central/source/browser/components/sessionstore/src/SessionSaver.jsm#288 This will require calling Services.tm.dispatch (http://dxr.mozilla.org/mozilla-central/source/xpcom/threads/nsIEventTarget.idl#30) to delay execution to the next tick and playing a little with Task.jsm and promise.
Do we have any data that tells us this is a thing we should do? Why not bring bug 944557 forward or add a telemetry measurement before doing this micro-optimization? It seems like this will complicate enough code to become awkward. For SessionSaver.run() writes wouldn't be dispatched synchronously anymore which could lead to dataloss if AsyncShutdown doesn't know there is a pending write.
Ok, let's wait for Telemetry.
Indeed, looking at Telemetry, this doesn't look too useful. Replaced by the almost equivalent but much more useful bug 984886.