Closed Bug 355805 Opened 15 years ago Closed 15 years ago
_Get Src Note is O(N^2)
STEPS TO REPRODUCE: 1) Enable JS strict warnings 2) Load http://mail.mozilla.com (or probably any other Zimbra page). 3) Observe the hang. 4) Profile it. EXPECTED RESULTS: No hang, hence nothing to profile ACTUAL RESULTS: Total hit count: 206039 Count %Total Function Name 125273 60.8 js_GetSrcNote 66450 32.3 js_SrcNoteLength Brendan sez: <brendan> yes, js_GetSrcNote has O(n^2) growth <brendan> know bug, wanted to fix it for 1.9alpha The JS file in question (Zimbra's Ajax_all.asc) is 600-some KB.
Patch that fixes the O(n^2) problem for typical lookup patterns is now attached in bug 346306. /be
bz, did the fix for bug 347306 make the Zimbra hang go away?
(In reply to comment #3) > bz, did the fix for bug 347306 make the Zimbra hang go away? I was seeing the Zimbra hang too (due to strict warnings being enabled), and bug 347306 fixed it for me.
OK, hang is down from "forever" to "15 seconds or so". Marking fixed; I'll file a followup on the remaining perf issues.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
js_SrcNoteLength was never a problem, because note arity is <= 3. /be
Summary: js_GetSrcNote and js_SrcNoteLength are O(N^2) → js_GetSrcNote is O(N^2)
> js_SrcNoteLength was never a problem That's not what jprof said. Unless it was simply in the profile because of the large number of calls from js_GetSrcNote? I filed bug 355951 on the remaining issue.
(In reply to comment #7) > > js_SrcNoteLength was never a problem > > That's not what jprof said. Unless it was simply in the profile because of the > large number of calls from js_GetSrcNote? Yes. /be
You need to log in before you can comment on or make changes to this bug.