Trim the XML output file - #321
Open
alfsb wants to merge 3 commits into
Open
Conversation
Member
Author
|
Got curious, and tested each reduction. |
jordikroon
reviewed
Jul 17, 2026
| // These first five elements account for almost 50% | ||
| // of all insignificant Docbook whitespace in manual. | ||
|
|
||
| $trimList[] = 'refsect1'; |
Member
There was a problem hiding this comment.
I prefer to use this form given it's a static array. But that's preference.
$trimList = [
// These first five elements account for almost 50%
// of all insignificant Docbook whitespace in manual.
'refsect1',
'varlistentry',
'...',
];
Member
Author
|
I'm delaying the merging of this PR, for now. There are some warnings being silenced on configure.php, and it is easier to check for insignificant differences without a change like this. |
alfsb
marked this pull request as draft
July 20, 2026 21:16
Member
Author
|
Rebased. Trim doctype, comments and duplicated namespaces. Removed trim of inter element whitespaces for now, as to avoid surfacing new PhD render errors. Final reductions:
Also, exports DOCTYPE node as doc-base/temp/doctype.dtd, so code that needs to know all DTD entities used in manuals can consult this file. Comments and reviews are welcome. Plan to merge this in one week. |
alfsb
marked this pull request as ready for review
August 3, 2026 17:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR trims the generated Docbook XML file of PHP Manual, assembled by doc-base/configure.php. It strips:
Statistics:
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.