Closed
Bug 1330231
Opened 8 years ago
Closed 7 months ago
DescribeScriptedCaller can be super inefficient on minified scripts with really long lines
Categories
(Core :: JavaScript Engine, defect, P3)
Core
JavaScript Engine
Tracking
()
RESOLVED
DUPLICATE
of bug 929950
People
(Reporter: ehsan.akhgari, Unassigned)
References
Details
(Keywords: triage-deferred)
See this profile: <https://clptr.io/2jC9bsJ>
We're spending ~15 *seconds* in PCToLineNumber, with SrcNoteLength and GetSrcNoteOffset showing up. They both have a loop over the jssrcnote data structure, and my guess is that they're looping on something which is linear in terms of the number of characters on each line.
This is awful since these scripts are super common on the web, and we call this function from many places in Gecko.
Naveed, can you please find an owner? Thanks!
Flags: needinfo?(nihsanullah)
Reporter | ||
Comment 1•8 years ago
|
||
The script in question is <https://27.talkgadget.google.com/_/scs/talk-static/_/js/k=wcs.chat.en.1tL2pLJBNFA.O/m=full/am=XA/rt=j/d=1/rs=AGyH-FvptjvTTQC529Y78zu2Mo91E1No0w>, line #9.
Comment 2•8 years ago
|
||
See also bug 929950 and bug 1245213. Is this with the profiler enabled?
We should consider replacing the source note stuff for line/column with something we can binary search. It's been on my list but I've a lot of JIT perf work going on atm.
Jason, Shu: can we prioritize this?
Reporter | ||
Comment 3•8 years ago
|
||
(In reply to Jan de Mooij [:jandem] from comment #2)
> See also bug 929950 and bug 1245213. Is this with the profiler enabled?
Yes.
> We should consider replacing the source note stuff for line/column with
> something we can binary search. It's been on my list but I've a lot of JIT
> perf work going on atm.
That'd be wonderful!
I also had a silly idea. Is it possible to annotate each bytecode with a lineno, making this O(1)?
Comment 4•8 years ago
|
||
(In reply to :Ehsan Akhgari (in Taipei, laggy response time) from comment #3)
> (In reply to Jan de Mooij [:jandem] from comment #2)
> > See also bug 929950 and bug 1245213. Is this with the profiler enabled?
>
> Yes.
>
> > We should consider replacing the source note stuff for line/column with
> > something we can binary search. It's been on my list but I've a lot of JIT
> > perf work going on atm.
>
> That'd be wonderful!
>
> I also had a silly idea. Is it possible to annotate each bytecode with a
> lineno, making this O(1)?
That would use too much memory, I'm afraid. I agree with Jan that binary search is the right compromise here.
I've always hated source notes, I can put it on my list.
Reporter | ||
Comment 5•8 years ago
|
||
WFM, thanks for looking into this guys!
Reporter | ||
Comment 6•8 years ago
|
||
Any updates here? DescribeScriptedCaller() is called in many places in Gecko, it would be nice if we didn't have this huge perf cliff...
Updated•7 years ago
|
Keywords: triage-deferred
Priority: -- → P3
Comment 7•6 years ago
|
||
Clearly ni on Naveed as he no longer works at Mozilla.
Flags: needinfo?(nihsanullah)
Updated•2 years ago
|
Severity: normal → S3
Updated•7 months ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•