Closed Bug 1245213 Opened 9 years ago Closed 8 months ago

Servo docs hang for >20s in buildIndex() when Gecko profiler is enabled

Categories

(Core :: JavaScript Engine, defect)

defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: bholley, Unassigned)

References

(Depends on 2 open bugs, )

Details

STR: (1) Install the gecko profiler addon in Nightly: https://github.com/bgirard/Gecko-Profiler-Addon/blob/master/geckoprofiler-signed.xpi?raw=true (2) Make sure the icon is enabled (not grey) (3) Visit http://doc.servo.org/string_cache/macro.atom!.html (4) Very long hang
Looks like we spend forever in buildIndex - the profiler may be screwing up the JIT somehow. Jan said he'd take a look.
Flags: needinfo?(jdemooij)
(In reply to Bobby Holley (busy) from comment #1) > Looks like we spend forever in buildIndex - the profiler may be screwing up > the JIT somehow. Jan said he'd take a look. Hm this also happens with the JITs disabled. According to a profile, we spend an insane amount of time under PCToLineNumber (called by the sampler thread). I'll do some digging to see if this is a large script or something.
Component: JavaScript Engine: JIT → JavaScript Engine
(In reply to Jan de Mooij [:jandem] from comment #2) > I'll do some digging to see if this is a large script or something. Bingo. We're loading this huge, 15.21 (!!) MB file: http://doc.servo.org/search-index.js And PCToLineNumber is choking on that...
Filed a rustdoc bug: https://github.com/rust-lang/rust/issues/31387 FWIW, PCToLineNumber being slow is nothing new (bug 929950).
Depends on: 929950
Bug 929950 is on my TODO list now, unfortunately I have some other things to do first.
Flags: needinfo?(jdemooij)
(In reply to Jan de Mooij [:jandem] from comment #5) > Bug 929950 is on my TODO list now, unfortunately I have some other things to > do first. Awesome - thanks for digging in Jan!
The file has very few lines for its size: $ wc search-index.js 167 316606 15954940 search-index.js Splitting lines some more help? Or is the time spent just proportional to the total file size?
(In reply to Simon Sapin (:SimonSapin) from comment #7) > Splitting lines some more help? Or is the time spent just proportional to > the total file size? Yes it's the total file size. We emit source notes for line and column numbers, and we walk all source notes from the start until we reach our bytecode pc. Splitting lines will result in more source notes, so it may actually make us slower (probably not noticeable though).
See Also: → 1330231
Depends on: 1409953

Although it's not badly slow when profiler is disabled, it still feels slower than ideal in cases like the page of Iterator trait.

See Also: → 1530212
Severity: normal → S3
Status: NEW → RESOLVED
Closed: 8 months ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.