Bug 148161 - Remove redundant attributes from configuration schema XML files
Summary: Remove redundant attributes from configuration schema XML files
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:24.8.0 target:25.2.0
Keywords: difficultyBeginner, easyHack, topicCleanup
Depends on:
Blocks: Dev-related
  Show dependency treegraph
 
Reported: 2022-03-24 11:02 UTC by Stephan Bergmann
Modified: 2024-11-22 07:03 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Bergmann 2022-03-24 11:02:04 UTC
The *.xcs XML files under officecfg/registry/schema/ (adhering to officecfg/registry/component-schema.dtd) redundantly contain some element attributes that explicitly spell out the attributes' implied default values.  For example, officecfg/registry/schema/org/openoffice/Office/Common.xcs contains

> <prop oor:name="Password" oor:type="xs:string" oor:localized="false">

where oor:localized="false" is the default for <prop> elements, anyway.

Removing such redundant data is beneficial, as it ends up in the *.xcd files that are processed when LibreOffice starts, so whatever is not present there speeds up start up by a tiny fraction.

The list of relevant attributes is:
* oor:extensible="false" for <group> elements
* oor:localized="false" for <prop> elements
* oor:nillable="true" for <prop> elements
Comment 1 Mike Kaganski 2022-03-24 11:08:19 UTC
Hmm, I generally see explicit default values as a plus, allowing one to avoid searching elsewhere for the default values. Could the tooling be improved instead to skip the values that match parent defaults?
Comment 2 Stephan Bergmann 2022-03-24 12:29:51 UTC
(In reply to Mike Kaganski from comment #1)
> Hmm, I generally see explicit default values as a plus, allowing one to
> avoid searching elsewhere for the default values.

But the vast majority of elements across officecfg/registry/schema/ already lack those explicitly-mentioned defaults, so I don't think this is a convincing argument to not drop the remaining few occurrences.

> Could the tooling be
> improved instead to skip the values that match parent defaults?

it presumably could, it's some XSLT code
Comment 3 Commit Notification 2024-01-28 18:10:04 UTC
Luv Sharma committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/971f9be4cdf84e3e04574ae5af86b732b2e5c161

tdf#148161 - Remove redundant attributes from configuration schema XML files

It will be available in 24.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2024-11-22 07:03:50 UTC
Bogdan Buzea committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/35f07a51850aeede7ef92dc2a2eae2326cff06a1

tdf#148161 - Remove redundant attributes from configuration schema XML files

It will be available in 25.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.