Open Bug 1462561 Opened 2 years ago Updated 2 months ago

reduce the cost of protocol.js's read/write methods

Categories

(DevTools :: Framework, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: ochameau, Unassigned)

References

(Blocks 5 open bugs)

Details

(Whiteboard: dt-fission-reserve)

During the various attempts to refactor actors to protocol.js (bug 1289193),
we often got regression reported by DAMP.
It became clear in bug 1449162 that read and write methods, in protocol.js are a source of slowness.
These methods are a key component of it. They are the methods that interpret the specifications and convert packets accordingly. "read" converts packets on the client side, to hand over objects to fronts, while "write" converts actors responses to packets.

These methods have two goals:
* map the input objects or packet to an object or packet:
  * it maps a request arguments to a given packet form
  * it maps an actor response object to a given packet form
* do custom marshalling:
  * when an actor methods returns an actor instance, the actor is automatically managed by the current actor and we return the actor form in the packet.
  * some actor do similar custom convertions like long string actor

In order to do that, these methods ends up:
* calling a log of function
  If the type of a request or response is complex, or if there is many values/attributes, we end up calling one such read/write method per attribute/value.
* duplicate all objects/arrays
  Except primitive types (string, boolean, json, ...), all other types used in specification will force duplicating the objects.

In this bug, I would like to see if we can reduce the number of function call and stop duplicating objects. In order to do that, we may have to get rid of some features/behaviors of protocol.js.
Severity: normal → enhancement
Priority: -- → P2
Blocks: 1449162
Product: Firefox → DevTools
Whiteboard: dt-fission
Whiteboard: dt-fission → dt-fission, dt-fission-framework
Whiteboard: dt-fission, dt-fission-framework → dt-fission
Priority: P2 → P3
Whiteboard: dt-fission → dt-fission-reserve
You need to log in before you can comment on or make changes to this bug.