Trim the XML output file - #321
Conversation
|
Got curious, and tested each reduction. |
| // These first five elements account for almost 50% | ||
| // of all insignificant Docbook whitespace in manual. | ||
|
|
||
| $trimList[] = 'refsect1'; |
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',
'...',
];|
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. |
|
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. |
@jordikroon , this may interest you. This has the potential to eliminate all My next step in configure is to minimize the DOCTYPE node to a single configure definition and usage, and by so, to restrict the SGML/DTD entity subsystem to only this line, in all manual.xml. |
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.