mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Fix GH-13988: Storing DOMElement consume 4 times more memory in PHP 8.1 than in PHP 8.0
We avoid creating backing storage by using the feature introduced in
f78d5cfcd2.
Closes GH-15593.
This commit is contained in:
3
NEWS
3
NEWS
@@ -2,6 +2,9 @@ PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? ????, PHP 8.4.0beta5
|
||||
|
||||
- DOM:
|
||||
. Fixed bug GH-13988 (Storing DOMElement consume 4 times more memory in
|
||||
PHP 8.1 than in PHP 8.0). (nielsdos)
|
||||
|
||||
27 Aug 2024, PHP 8.4.0beta4
|
||||
|
||||
|
||||
@@ -1083,6 +1083,7 @@ PHP 8.4 UPGRADE NOTES
|
||||
an xpath query. This can give a time improvement of easily two order of
|
||||
magnitude for documents with tens of thousands of nodes.
|
||||
. Improved performance and reduce memory consumption of XML serialization.
|
||||
. Reduced memory usage of node classes.
|
||||
|
||||
- FTP:
|
||||
. Improved the performance of FTP uploads up to a factor of 10x for large
|
||||
|
||||
@@ -182,7 +182,7 @@ URL: https://dom.spec.whatwg.org/#dom-element-classlist
|
||||
*/
|
||||
zend_result dom_element_class_list_read(dom_object *obj, zval *retval)
|
||||
{
|
||||
const uint32_t PROP_INDEX = 20;
|
||||
const uint32_t PROP_INDEX = 0;
|
||||
|
||||
#if ZEND_DEBUG
|
||||
zend_string *class_list_str = ZSTR_INIT_LITERAL("classList", false);
|
||||
|
||||
@@ -83,7 +83,7 @@ typedef struct dom_decoding_encoding_ctx {
|
||||
/* https://dom.spec.whatwg.org/#dom-document-implementation */
|
||||
zend_result dom_modern_document_implementation_read(dom_object *obj, zval *retval)
|
||||
{
|
||||
const uint32_t PROP_INDEX = 14;
|
||||
const uint32_t PROP_INDEX = 0;
|
||||
|
||||
#if ZEND_DEBUG
|
||||
zend_string *implementation_str = ZSTR_INIT_LITERAL("implementation", false);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
360
ext/dom/php_dom_arginfo.h
generated
360
ext/dom/php_dom_arginfo.h
generated
File diff suppressed because it is too large
Load Diff
@@ -28,9 +28,9 @@ foreach ($dataNodes AS $node) {
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECTF--
|
||||
int(3)
|
||||
object(DOMText)#7 (23) {
|
||||
object(DOMText)#%d (23) {
|
||||
["wholeText"]=>
|
||||
string(3) "
|
||||
"
|
||||
@@ -82,15 +82,15 @@ object(DOMText)#7 (23) {
|
||||
string(3) "
|
||||
"
|
||||
}
|
||||
object(DOMElement)#7 (27) {
|
||||
["schemaTypeInfo"]=>
|
||||
NULL
|
||||
object(DOMElement)#%d (27) {
|
||||
["tagName"]=>
|
||||
string(5) "form1"
|
||||
["className"]=>
|
||||
string(0) ""
|
||||
["id"]=>
|
||||
string(0) ""
|
||||
["schemaTypeInfo"]=>
|
||||
NULL
|
||||
["firstElementChild"]=>
|
||||
string(22) "(object value omitted)"
|
||||
["lastElementChild"]=>
|
||||
@@ -146,7 +146,7 @@ object(DOMElement)#7 (27) {
|
||||
Value C
|
||||
"
|
||||
}
|
||||
object(DOMText)#7 (23) {
|
||||
object(DOMText)#%d (23) {
|
||||
["wholeText"]=>
|
||||
string(1) "
|
||||
"
|
||||
|
||||
@@ -24,14 +24,14 @@ var_dump($target);
|
||||
--EXPECTF--
|
||||
<a>barfoobaz<last/></a>
|
||||
object(DOMElement)#3 (27) {
|
||||
["schemaTypeInfo"]=>
|
||||
NULL
|
||||
["tagName"]=>
|
||||
string(4) "last"
|
||||
["className"]=>
|
||||
string(0) ""
|
||||
["id"]=>
|
||||
string(0) ""
|
||||
["schemaTypeInfo"]=>
|
||||
NULL
|
||||
["firstElementChild"]=>
|
||||
NULL
|
||||
["lastElementChild"]=>
|
||||
@@ -81,14 +81,14 @@ object(DOMElement)#3 (27) {
|
||||
}
|
||||
<a><last/>barfoobaz</a>
|
||||
object(DOMElement)#2 (27) {
|
||||
["schemaTypeInfo"]=>
|
||||
NULL
|
||||
["tagName"]=>
|
||||
string(4) "last"
|
||||
["className"]=>
|
||||
string(0) ""
|
||||
["id"]=>
|
||||
string(0) ""
|
||||
["schemaTypeInfo"]=>
|
||||
NULL
|
||||
["firstElementChild"]=>
|
||||
NULL
|
||||
["lastElementChild"]=>
|
||||
|
||||
Reference in New Issue
Block a user