MPS issue job003975

TitlePoor performance due to imbalance between protection and scanning costs
Statusclosed
Priorityessential
Assigned userRichard Brooksby
OrganizationRavenbrook
DescriptionThe MPS was designed at a time when memory protection was cheap compared to scanning, and so it tends to protect memory to avoid a scan. This assumption has changed over time, and is seriously wrong on OS X, where protection is expensive. The MPS makes poor decisions about when to protect to avoid a scan.
AnalysisChangelist 186975 wins big for Clasp on OS X by deferring write barriers until a number of "unnecessary" scans have been done. It also appears to improve CVM performance on Windows <https://info.ravenbrook.com/mail/2016/03/05/16-05-03/0/>.
1. Verify performance improvements from DL's change and release to clients if it is a positive step as is.
2. Analyse telemetry output and/or write some test programs to estimate the relative costs. Express those costs to the MPS (even as constants, per platform) and use them to make better decisions. Make sure we review these constants are regular intervals (even in the test suite) to make sure they are reasonable.
3. Have the MPS measure the costs dynamically.
Changelist 189664 has a trial merge of these changes with custom/cet/main, for testing with CVM.
How foundunknown
Evidence<https://info.ravenbrook.com/mail/2016/03/05/16-05-03/0/>
Discussion on #Clasp
Created byRichard Brooksby
Created on2016-03-08 11:19:10
Last modified byRichard Brooksby
Last modified on2016-03-24 17:32:21
History2016-03-08 RB Created.

Fixes

Change Effect Date User Description
190380 closed 2016-03-24 12:07:20 Richard Brooksby Merging branch/2016-03-13/defer-write-barrier into master sources.
190376 closed 2016-03-24 11:47:37 Richard Brooksby Merging branch/2016-03-11/shield-coalesce into master sources.