Closed Bug 958269 Opened 10 years ago Closed 10 years ago

Don't call toSource on objects passed to console.log

Categories

(Firefox for Metro Graveyard :: General, defect)

All
Windows 8.1
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 29

People

(Reporter: mbrubeck, Assigned: mbrubeck)

Details

(Keywords: perf)

Attachments

(1 file)

Attached patch patchSplinter Review
Our console API implementation calls toSource when passed an object.  This can lead to bad performance problems, especially in cases where where it goes into an infinite loop trying to serialize a circular or otherwise badly-behaved object.  This is causing unresponsive script alerts on http://newsblur.com for example.

This is just one of the perf issues with our console; maybe we should kill it and just move to remote console only.
Attachment #8357989 - Flags: review?(tabraldes)
Comment on attachment 8357989 [details] [diff] [review]
patch

Review of attachment 8357989 [details] [diff] [review]:
-----------------------------------------------------------------

(In reply to Matt Brubeck (:mbrubeck) from comment #0)
> Created attachment 8357989 [details] [diff] [review]
> patch
> 
> Our console API implementation calls toSource when passed an object.  This
> can lead to bad performance problems, especially in cases where where it
> goes into an infinite loop trying to serialize a circular or otherwise
> badly-behaved object.  This is causing unresponsive script alerts on
> http://newsblur.com for example.
> 
> This is just one of the perf issues with our console; maybe we should kill
> it and just move to remote console only.

+1. I can't count the number of times I've killed my metroFx by trying to open the error console.
Attachment #8357989 - Flags: review?(tabraldes) → review+
https://hg.mozilla.org/mozilla-central/rev/8d8dbdcec065
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 29
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: