Open Bug 1998210 Opened 11 months ago Updated 11 months ago

ObjectToSource is inefficient and can create very large output strings

Categories

(Core :: JavaScript Engine, defect, P5)

defect

Tracking

()

People

(Reporter: jonco, Unassigned)

References

(Blocks 1 open bug)

Details

This is not high priority as this is not really exposed to the web any more, but it is used when creating error messages which can be triggered from the web.

ObjectToSource is very inefficient. It creates creates tons of intermediate JSStrings as it builds up its output and this can cause unnecessary GC activity and take a long time.

Also the size of its output is also basically unbounded. Including multiple MBs of object representation in error messages is not useful.

For a situation where this can happen see the testcase in bug 1968172.

Ideally this would 1) use a JSStringBuffer to build up the result rather than creating JSStrings and concatenating them 2) allow a size limit on the output to be specified.

See Also: → 1968172
Blocks: jserror
You need to log in before you can comment on or make changes to this bug.