Skip to content

Trim the XML output file#321

Open
alfsb wants to merge 5 commits into
php:masterfrom
alfsb:the-big-trim
Open

Trim the XML output file#321
alfsb wants to merge 5 commits into
php:masterfrom
alfsb:the-big-trim

Conversation

@alfsb

@alfsb alfsb commented Jul 14, 2026

Copy link
Copy Markdown
Member

This PR trims the generated Docbook XML file of PHP Manual, assembled by doc-base/configure.php. It strips:

  1. The DOCTYPE node (after entity expansion);
  2. Duplicated XML namespaces;
  3. XML comments;
  4. Insignificant whitespaces of Docbook.

Statistics:

  • File reduction, bytes: -30,90%, from 44736907 to 30913772;
  • File reduction, lines: -68,04%, from 1404683 to 448958;
  • Maximum resident set size: -16,31%, from 1781788 to 1491252 kb.
  • Time increase: about +0.25s

I'm surprised that the time increase is so small, but more surprised to see a reduction in Maximum resident set size. This means that the peak memory occurs later in configure (or any of its subs scripts), after the initial assembly.

Testing with PhD will be done in future. I expect no functional changes, but a full test is necessary anyways. PhD developers may need to check this very critically. Included a tool to recalculate the list, in the case the RNGs are updated.

Comments and reviews are welcome. Plan to wait at least two weeks before merging.

@alfsb

alfsb commented Jul 14, 2026

Copy link
Copy Markdown
Member Author

Got curious, and tested each reduction.

Final size  Component   Reduction   Red%

44736907	original		
42815943	DTD	        -1920964	-4,29%
39039498	xmlns	    -3776445	-8,44%
33554966	comments	-5484532	-12,26%
30913772	dbwsi	    -2641194	-5,90%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant