Closed
Bug 150015
Opened 22 years ago
Closed 17 years ago
trace-malloc slows down builds even when not used
Categories
(Core :: XPCOM, defect, P1)
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha8
People
(Reporter: dbaron, Assigned: dbaron)
Details
Attachments
(1 file, 2 obsolete files)
4.59 KB,
patch
|
brendan
:
review+
bzbarsky
:
approval1.9+
|
Details | Diff | Splinter Review |
trace-malloc slows down builds even when it's not used (no --trace-malloc argument on the command line), by roughly a factor of 4, even though, as far as I know, there's no way to get useful output from it (I might be wrong here, though). suppress_tracing is never even set to non-zero. I'm going to attach a patch that I think should fix this problem (and which makes my debug build usable again).
Assignee | ||
Comment 1•22 years ago
|
||
Are there any ways of using trace-malloc that this would break?
Assignee | ||
Updated•22 years ago
|
Status: NEW → ASSIGNED
Priority: -- → P1
Target Milestone: --- → mozilla1.1beta
Comment 2•22 years ago
|
||
Yes, this will break scripted uses (see dom/src/base/nsJSEnvironment.cpp, look for TraceMalloc). /be
Assignee | ||
Comment 3•22 years ago
|
||
I could never get those to work without using --trace-malloc on the command-line anyway. I thought it had something to do with an initial buffer size. Maybe my memory is wrong, though...
Assignee | ||
Updated•22 years ago
|
Target Milestone: mozilla1.1beta → mozilla1.2alpha
Assignee | ||
Updated•22 years ago
|
Target Milestone: mozilla1.2alpha → Future
Assignee | ||
Comment 4•22 years ago
|
||
Pretty much the same thing, but fixes a bogus |return;|. (For reference. No intent to check in.)
Attachment #86831 -
Attachment is obsolete: true
Updated•18 years ago
|
QA Contact: scc → xpcom
Assignee | ||
Comment 5•17 years ago
|
||
Here's the patch again (rewritten from the last one, since it uses different variable names).
Attachment #103407 -
Attachment is obsolete: true
Attachment #274855 -
Flags: review?(brendan)
Assignee | ||
Comment 7•17 years ago
|
||
(Except I'm not sure how the enable/disable functions ever worked dynamically, or what they'd be used for.)
Assignee | ||
Comment 8•17 years ago
|
||
Though, actually, this patch fixes Enable/Disable by setting tracing_enabled, so maybe it's ok (or as ok as it's always been).
Comment 9•17 years ago
|
||
Comment on attachment 274855 [details] [diff] [review] patch >+ if (!PR_Initialized() || !tracing_enabled) { Transpose these || terms for faster results, right? With the same change elsewhere, r=me. /be
Attachment #274855 -
Flags: review?(brendan) → review+
Assignee | ||
Comment 10•17 years ago
|
||
Comment on attachment 274855 [details] [diff] [review] patch This is a performance fix for the trace-malloc debugging tool that makes it so that trace-malloc doesn't degrade performance significantly when it is compiled in but not used. This will make it easier for other developers to build trace-malloc and debug leaks without suffering the degradation. No risk to releases, which don't ship this code.
Attachment #274855 -
Flags: approval1.9?
Comment 11•17 years ago
|
||
Comment on attachment 274855 [details] [diff] [review] patch a=bzbarsky
Attachment #274855 -
Flags: approval1.9? → approval1.9+
Assignee | ||
Comment 12•17 years ago
|
||
Fix checked in to trunk, 2007-08-10 14:24.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Target Milestone: Future → mozilla1.9 M8
You need to log in
before you can comment on or make changes to this bug.
Description
•