Open Bug 1825270 Opened 1 year ago Updated 1 year ago

Performance issue (+ memory consumption) when using inspector search

Categories

(DevTools :: General, defect, P2)

Firefox 111
defect

Tracking

(Not tracked)

People

(Reporter: naaoffupzhgyjmssxg, Unassigned)

References

Details

Attachments

(1 file)

Attached image firefox_memory_leak.png

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0

Steps to reproduce:

Actual results:

there is a large memory consumption

Expected results:

it should find tbody without issues

The Bugbug bot thinks this bug should belong to the 'Core::Performance' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Performance
Product: Firefox → Core

I saw a 200MB memory increase when searching, and got this profile: https://share.firefox.dev/3LXibVB

Component: Performance → General
Product: Core → DevTools

Comment on attachment 9325685 [details]
firefox_memory_leak.png

This is my profile: https://share.firefox.dev/3lKXqC5

Right, the view source markup for this page is huge, so doing a search in the inspector performs really badly.

We can look at the performance issue regardless, but is there a good reason to use the inspector search here? We are already on a source view, so I think you could directly use the built-in page search?

Flags: needinfo?(naaoffupzhgyjmssxg)

For reference, the markup of view-source for this specific page has 436415 elements.

You are right, I've reported it because if it's reproducible maybe it can be a good test to investigate the memory leak, or maybe it's a my machine fault, Mayank's profile is not bad as mine.

Flags: needinfo?(naaoffupzhgyjmssxg)

Makes sense, and that's indeed a good test case to easily trigger the performance issue.

cc Emilio who is modifying this area at the moment, but we should definitely have a look once the code has been reshuffled.

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P2
Summary: memory leak in view-source → Performance issue (+ memory consumption) when using inspector search

Yet another profile for comment 0 STR (doing three search for tbody):
https://share.firefox.dev/40H6UNX
Highlights many calls to nextNode itself spending what looks like an abnormal amount of time in isInXULDocument (it should probably be cached instead of being called so many times).

Also standardTreeWalkerFilter is called a lot and seems to spend lot of time in js::ProxyGetProperty.
May be we could fetch nodeName only once here?
https://searchfox.org/mozilla-central/rev/55d5c4b9dffe5e59eb6b019c1a930ec9ada47e10/devtools/server/actors/inspector/utils.js#136-142
Also, may be the order of these condition could be shuffled to be ordered to typical order of "positiveness".

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: