Open Bug 1281960 Opened 8 years ago Updated 2 years ago

console.log loses track of updates in large loops

Categories

(DevTools :: Console, defect, P3)

50 Branch
defect

Tracking

(firefox50 affected)

Tracking Status
firefox50 --- affected

People

(Reporter: emceeaich, Unassigned)

Details

(Whiteboard: [console-rewrite-fix])

Attachments

(1 file)

Run this in console:

for (let i = 0; i < 10000; i++) { console.log(typeof null == 'undefined'); }

I expected to see: `false     (10000)`

but got: `false     (4677)` 

see attachment
The output can end up getting messages removed do to the batching and pruning that happens because of performance issues in the frontend. When a message is sent, it's queued up and all of them get sent for rendering after N ms (20).  But if there are more messages than will be displayed in the frontend at once (1000, I think) then it ends up discarding them before attempting to render.

All of this happens before any repeat checking and so we end up skipping messages.  Definitely a bug, since in this case the messages that are not meant to ever be seen actually end up changing the display of one that does (by incrementing the repeat bubble).  But it's in a bit of a tricky and performance sensitive piece of code so isn't likely to get fixed in the current frontend.  Luckily the work in progress of the console rewrite (started in Bug 1260283 but still preffed off) is properly showing 10000 messages in the bubble so we'll keep this open and revisit it when that work is complete.
Priority: -- → P3
Whiteboard: [console-rewrite-fix]
Product: Firefox → DevTools
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: