Bug 92785 - Sort configuration on write ...
Summary: Sort configuration on write ...
Status: RESOLVED WONTFIX
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
5.0.0.0.beta1
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: difficultyBeginner, easyHack, skillCpp, topicCleanup
Depends on:
Blocks:
 
Reported: 2015-07-16 12:53 UTC by Michael Meeks
Modified: 2016-02-18 16:37 UTC (History)
1 user (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 Michael Meeks 2015-07-16 12:53:44 UTC
It seems that recently we switched from storing our configuration in a std::map to an unordered_set or something equivalent. Most likely this has some good size and performance characteristics - so we want to keep it that way =)

Unfortunately - it also introduces non-determinism when writing the the instdir/user/registrymodifications.xcu (run an xmllint --format on that before and after a load and exit to see the difference ;-).

This is not ideal =) Luckily writing that is done asynchronously in its own thread - so we can use plenty of CPU there.

It would be great to hack:

configmgr/source/writemodfile.cxx

To tackle this sort of iteration (there are several of these in there):

        for (NodeMap::const_iterator i(node->getMembers().begin());
             i != node->getMembers().end(); ++i)

And to instead have a local function that builds a new sorted vector of the nodes we want to write. Then if ~nothing changes in the config we can see what did change.

Thanks ! =)
Comment 1 Stephan Bergmann 2015-07-16 13:05:28 UTC
(In reply to Michael Meeks from comment #0)
> And to instead have a local function that builds a new sorted vector of the
> nodes we want to write. Then if ~nothing changes in the config we can see
> what did change.

As each <item> is written to an individual line,

  diff <(sort registrymodifications.xcu-old) <(sort registrymodifications.xcu-new)

should show that difference reasonably well, too.
Comment 2 Robinson Tryon (qubit) 2015-12-10 11:41:01 UTC
Migrating Whiteboard tags to Keywords: (easyHack, difficultyBeginner, skillCpp, topicCleanup)
Comment 3 Stephan Bergmann 2016-01-15 14:48:39 UTC
closing as WONTFIX based on the (IMO sufficient?) workaround in comment 2
Comment 4 Robinson Tryon (qubit) 2016-02-18 16:37:07 UTC
Remove LibreOffice Dev List from CC on EasyHacks
(curtailing excessive email to list)
[NinjaEdit]