Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:104724 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 25297 invoked from network); 14 Mar 2019 22:44:29 -0000 Received: from unknown (HELO mail-ot1-f53.google.com) (209.85.210.53) by pb1.pair.com with SMTP; 14 Mar 2019 22:44:29 -0000 Received: by mail-ot1-f53.google.com with SMTP id b3so6233263otp.4 for ; Thu, 14 Mar 2019 12:34:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wikimedia.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=N5UO8nT+JJeqSQah34oN/GxSdytQWNdLaQld16cbgD0=; b=X84q1ZhELIp43pth/kNkYg13cdtNqdsIxfWV2llqW42GSNVUXyCV5YSpc7G84ldTbn wKHCZgHE8ZvKtmP9rXtPdQWmNj/NB5Zxz5EfsPwkxKmxsMkhzfdywVMO8jdsk6aadHb7 q7/BiBLDGfN3tmR/ZzgSfLsLXG7GDF8ZU0Zw0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=N5UO8nT+JJeqSQah34oN/GxSdytQWNdLaQld16cbgD0=; b=hDuIhE0TaUkXu5nJx/ZblFPTRQqLCWgzC92/Xnwf91caJiN1/3pCvJkHaKgybrALKN Jk9Pl9eSiBZANFcxq79tw645OpKJM9BJ7W4ERGj4MMtMlmUbAF37fBsWjCd3I7FkILra BwFjHs52x8+nBHbUkhCu3gdNc5+T+6URNT8n+Kuub9Uxb3ekeogfv5cVgEcGnsO/bECP almGezOe1lt/VGcmAtnegcdenZ3q3Cz8x54kLos9Gvb7E6AEyMC5Tz/uZJLbKsW/yU6M xeergKxAuRjMEPiPXz3qRrJfHywQ1LJRSRqpB4fMftbVOixpqlkRRuttyWAu9mDVXybP M+qA== X-Gm-Message-State: APjAAAWBjsIef4hFH7se6KqRpk3iI/3MMQSSvva8Y+QgehdaM7oMpRvx H8Y0WhOzNz2Mj/IpLSKtXHh3LHnuLILfQUKvNlcrfxGM X-Google-Smtp-Source: APXvYqz4ZDkid+PnCyXp+w135UeqgAo5lWKta4o5zv6tH9r39+XeiYb71FCEyzUnKDvBGR7XwwUIMNky31dU6x/p4rA= X-Received: by 2002:a9d:66cb:: with SMTP id t11mr29891017otm.247.1552592096397; Thu, 14 Mar 2019 12:34:56 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 14 Mar 2019 15:34:45 -0400 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000631e2d0584130499" Subject: dom_reconcile_ns performance (or lack thereof) From: cananian@wikimedia.org ("C. Scott Ananian") --000000000000631e2d0584130499 Content-Type: text/plain; charset="UTF-8" I note that there was some recent discussion about fixing DOMNameSpaceNode on this list. I'd like to bring up a (perhaps) related issue: the dom_reconcile_ns() function which is called whenever a new namespaced node (for example, created with Document#createElementNS) is inserted into the tree. dom_reconcile_ns() does a full walk up to the root of the DOM (via the call to xmlSearchNsByHref) which can create a quadratic slowdown for deeply-nested documents. What is this function doing? Can we do it lazily? Technically HTML elements should be created in the HTML namespace, but doing so leads to extreme performance loss -- parsing a 2MB file goes from 0.4s (with Document#createElement()) to 2.5s (with Document#createElementNS()). --scott -- (http://cscott.net) --000000000000631e2d0584130499--