Consider to have a larger cache for MiscContainer
Categories
(Core :: DOM: Core & HTML, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox113 | --- | fixed |
People
(Reporter: smaug, Assigned: smaug)
References
(Blocks 1 open bug)
Details
(Whiteboard: [sp3-experiment])
Attachments
(1 file)
This would improve React-Stockcharts-SVG/ZoomTheChart/Sync a tiny bit.
It is the calling of malloc several times in a row (to fill the cache) which seems to help here.
The test creates lots of MiscContainers (>10000), so just increasing the size of the cache doesn't affect too much, since it would be empty all the time.
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
Assignee | ||
Comment 2•2 years ago
|
||
if I remove the old cache https://searchfox.org/mozilla-central/rev/336ff5573f4b7aa8e981429093c051b3f78237ec/dom/base/nsAttrValue.h#563 stylo starts complaining about error[E0412]: cannot find type MiscContainer in module structs.
Error is coming from let container = ptr::structs::MiscContainer(attr);
What magic do I need to tell stylo about MiscContainer?
Comment 3•2 years ago
|
||
This is one of those types we don't use in any FFI functions so bindgen doesn't generate them by default. Something like this should do tho:
diff --git a/dom/base/nsAttrValue.cpp b/dom/base/nsAttrValue.cpp
index b4ce9a645971e..2a37dca7d7959 100644
--- a/dom/base/nsAttrValue.cpp
+++ b/dom/base/nsAttrValue.cpp
@@ -144,7 +144,6 @@ void MiscContainer::Evict() {
}
nsTArray<const nsAttrValue::EnumTable*>* nsAttrValue::sEnumTableArray = nullptr;
-MiscContainer* nsAttrValue::sMiscContainerCache = nullptr;
nsAttrValue::nsAttrValue() : mBits(0) {}
diff --git a/dom/base/nsAttrValue.h b/dom/base/nsAttrValue.h
index 2778d3f4819ba..6f5a572c421b8 100644
--- a/dom/base/nsAttrValue.h
+++ b/dom/base/nsAttrValue.h
@@ -560,7 +560,6 @@ class nsAttrValue {
static void DeallocMiscContainer(MiscContainer* aCont);
static nsTArray<const EnumTable*>* sEnumTableArray;
- static MiscContainer* sMiscContainerCache;
/**
* Helper for ParseHTMLDimension and ParseNonzeroHTMLDimension.
diff --git a/layout/style/ServoBindings.toml b/layout/style/ServoBindings.toml
index 0b8fe0e38bfb5..b33691847c5c6 100644
--- a/layout/style/ServoBindings.toml
+++ b/layout/style/ServoBindings.toml
@@ -268,6 +268,7 @@ allowlist-types = [
"mozilla::MediumFeaturesChangedResult",
"nsAttrName",
"nsAttrValue",
+ "MiscContainer",
"nscolor",
"nsChangeHint",
"nsCSSCounterDesc",
Updated•2 years ago
|
Assignee | ||
Comment 4•2 years ago
|
||
Updated•2 years ago
|
Comment 6•2 years ago
|
||
bugherder |
Description
•