php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #44761 DOM & Large Files
Submitted: 2008-04-17 14:34 UTC Modified: 2011-10-15 12:03 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: xwisdom at yahoo dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.2.5 OS: Windows XP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: xwisdom at yahoo dot com
New email:
PHP Version: OS:

 

 [2008-04-17 14:34 UTC] xwisdom at yahoo dot com
Description:
------------
I think the (X)HTML DOM features are great but I would like for it to process the DOMDocument much faster.

It appears that the HTML DOM features in php are not able to handle large html files (200k+). It's slow down when processing these files.

I would like to request that the DOM processing objects be given a speed boost. The DOM that's present in the browsers are much faster at processing the element. If this can be done then it would be great!






Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-10-14 15:27 UTC] clicky at erebot dot net
The DOM extension is meant explicitely to handle small XML files as it requires a copy of the file being processed and a large number of objects be kept in memory (this is also true for the SimpleXML extension which is based on the same underlying parsing library).

If you need a faster alternative, I'd suggest you take a look at the XMLReader and XML Parser extensions (http://php.net/manual/en/book.xmlreader.php and http://php.net/manual/en/book.xml.php, respectively).
XMLReader works by using a cursor-based parsing approach, while XML Parser uses a push-based approach.
Here are some drawbacks though when using these extensions:
- validation may not be possible (true XML Parser)
- you can't use XPath to browse through the data (true for both extensions)

Hope this helps.
 [2011-10-15 12:03 UTC] rrichards@php.net
-Status: Open +Status: Bogus -Package: Feature/Change Request +Package: *General Issues
 [2011-10-15 12:03 UTC] rrichards@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 14 14:01:31 2025 UTC