Closed Bug 1820625 Opened 3 years ago Closed 2 years ago

Investigate the performance of the DOMParser and see if there are any mitigations

Categories

(Firefox :: Translations, task, P3)

task

Tracking

()

RESOLVED WONTFIX

People

(Reporter: gregtatum, Unassigned)

References

Details

The addon used innerHTML for setting the contents of a DOM element. In the TranslationsDocument, we are using a DOMParser. This is an order of magnitude slower mostly from having to create a full Document element for every node that gets translated. We should investigate if there is a better solution for this that is still secure.

Blocks: 1820214

Since this is a general performance improvement, I'm going to move it from the Desktop MVP to the general backlog.

No longer blocks: 1820214
Blocks: 1837421
No longer blocks: fx-translation

https://share.firefox.dev/3Tx3GeI

I think this is a WONTFIX. The DOMParser seems much faster these days. I wish I had retained a profile from when I had filed this bug, but my memory of the timing was that it was mostly spent in creating the document object. I don't see that work now. The parseFragment code doesn't seem to be any faster now.

It is slower to use a parser, but doesn't seem as drastic as it used to be. This is probably an acceptable trade-off due to the safety of not using innerHTML.

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