[SERVER-77825] optimize Decorations that are initialized to an "empty" state Created: 06/Jun/23  Updated: 29/Oct/23  Resolved: 24/Aug/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.1.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Billy Donahue Assignee: Billy Donahue
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-78390 Decorable subsystem refactoring Closed
Problem/Incident
causes SERVER-81848 Make decoration construction eager again Closed
Related
related to SERVER-79957 benchmark Decorations Closed
is related to SERVER-76788 Elide useless constructor calls for t... Closed
Assigned Teams:
Service Arch
Backwards Compatibility: Fully Compatible
Sprint: Service Arch 2023-06-26, Service Arch 2023-07-10, Service Arch 2023-07-24, Service Arch 2023-08-07, Service Arch 2023-08-21, Service Arch 2023-09-04
Participants:

 Description   

SERVER-76788 elided constructors for trivially-constructible Decorations. That work was not as efficacious as it could have been because it turns out that only a few relevant decorations are truly trivially constructible.

However, many decorations are initialized to an "empty" value. It's just that doing so isn't technically trivial, so we have to run a nop constructor for them. We do know that the buffer for Decorations is memset with 0-bytes. So we could invent a small wrapper type that considers the zero-filled representation to be valid and empty, and we would have no constructor work necessary for those.

It's still unclear that doing this optimization would save initialization time.
SERVER-78390 will make this easier to work on.



 Comments   
Comment by Githook User [ 24/Aug/23 ]

Author:

{'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}

Message: SERVER-77825 Decoration lazy-init for nontrivial objects
Branch: master
https://github.com/mongodb/mongo/commit/586d02e42a9d10bb43769b62e736fe67d6dc44ca

Comment by Billy Donahue [ 23/Jun/23 ]

May or may not be achievable without SERVER-78390. Marked as a dependency but we'll try a minimal diff first.

Comment by Billy Donahue [ 23/Jun/23 ]

Expediting as a speculative optimization for 7.0 release.

Comment by Billy Donahue [ 06/Jun/23 ]

carries on the work of SERVER-76788, and has the potential to multiply its effects.

Generated at Thu Feb 08 06:36:42 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.