Open Bug 1487234 Opened 7 years ago Updated 3 years ago

Consider shrinking the Performance object

Categories

(Core :: DOM: Core & HTML, defect, P3)

defect

Tracking

()

People

(Reporter: bzbarsky, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [MemShrink:P3][overhead:8K])

Performance is eagerly allocated when we create a Window, so we can rely on it being in a slot for performance.now(). But a Performance object is not that small (looks like an 8KB allocation). Might be worth shrinking it down some by lazily allocating some of its members. From a DMD log: Unreported { 40 blocks in heap block record 59 of 6,988 327,680 bytes (170,240 requested / 157,440 slop) Individual block sizes: 8,192 x 40 0.07% of the heap (28.63% cumulative) 0.18% of unreported (77.77% cumulative) Allocated at { #01: replace_malloc(unsigned long) (DMD.cpp:1267, in libmozglue.dylib) #02: moz_xmalloc (mozalloc.cpp:71, in libmozglue.dylib) #03: mozilla::dom::Performance::CreateForMainThread(nsPIDOMWindowInner*, nsIPrincipal*, nsDOMNavigationTiming*, nsITimedChannel*) (mozalloc.h:136, in XUL) #04: nsPIDOMWindowInner::CreatePerformanceObjectIfNeeded() (RefPtr.h:64, in XUL) #05: nsPIDOMWindowInner::GetPerformance() (RefPtr.h:296, in XUL) #06: mozilla::dom::Window_Binding::get_performance(JSContext*, JS::Handle<JSObject*>, nsGlobalWindowInner*, JSJitGetterCallArgs) (.WindowBinding.cpp:4356, in XUL) #07: mozilla::dom::Window_Binding::ClearCachedPerformanceValue(JSContext*, nsGlobalWindowInner*) (.WindowBinding.cpp:17051, in XUL) #08: nsGlobalWindowInner::InnerSetNewDocument(JSContext*, nsIDocument*) (nsGlobalWindowInner.cpp:7508, in XUL) } }
Priority: -- → P3
Whiteboard: [MemShrink]
Whiteboard: [MemShrink] → [MemShrink:P3]
Whiteboard: [MemShrink:P3] → [MemShrink:P3][overhead:8K]
Component: DOM → DOM: Core & HTML
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.