[php-src] master: Improve performance of text node allocation by marking the text node construction as always inline
| From: | Niels Dossche | Date: | Sun, 28 Apr 2024 08:32:50 +0000 |
| Subject: | [php-src] master: Improve performance of text node allocation by marking the text node construction as always inline | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-128240@lists.php.net to get a copy of this message | ||
Author: Niels Dossche (nielsdos)
Date: 2024-04-28T10:32:41+02:00
Commit: https://github.com/php/php-src/commit/a86e6687640c3ef8c32a86034ab2cf46b9917909
Raw diff: https://github.com/php/php-src/commit/a86e6687640c3ef8c32a86034ab2cf46b9917909.diff
Improve performance of text node allocation by marking the text node construction as always inline
Changed paths:
M ext/dom/html5_parser.c
Diff:
diff --git a/ext/dom/html5_parser.c b/ext/dom/html5_parser.c
index 794050a33ed9..87e62d6fd88d 100644
--- a/ext/dom/html5_parser.c
+++ b/ext/dom/html5_parser.c
@@ -73,7 +73,7 @@ static const php_dom_ns_magic_token *get_libxml_namespace_href(uintptr_t lexbor_
}
}
-static xmlNodePtr lexbor_libxml2_bridge_new_text_node_fast(xmlDocPtr lxml_doc, const lxb_char_t
*data, size_t data_length, bool compact_text_nodes)
+static zend_always_inline xmlNodePtr lexbor_libxml2_bridge_new_text_node_fast(xmlDocPtr lxml_doc,
const lxb_char_t *data, size_t data_length, bool compact_text_nodes)
{
if (compact_text_nodes && data_length < LXML_INTERNED_STRINGS_SIZE) {
/* See xmlSAX2TextNode() in libxml2 */