Open
Bug 1819282
Opened 2 years ago
getBreakableLines could be faster for minified files
Categories
(DevTools :: Debugger, task)
DevTools
Debugger
Tracking
(Not tracked)
NEW
People
(Reporter: nchevobbe, Unassigned)
References
Details
Here's a profile opening a large minified file which only contains 2 lines: https://share.firefox.dev/3KIC6H9
We can see that the call to the source actor getBreakableLines
method is taking almost half a second to complete on my (fast) machine.
This is because the function is quite naive, getting all the possible breakable positions, and then only extracting lines.
A solution would be to loop through the different lines and check if there's a breakable position in it, and bail out as soon as we can validate this
async getBreakableLines() {
const positions = await this.getBreakpointPositions();
const lines = new Set();
for (const position of positions) {
if (!lines.has(position.line)) {
lines.add(position.line);
}
}
return Array.from(lines);
}
You need to log in
before you can comment on or make changes to this bug.
Description
•