[SERVER-45216] Rename Document::size() to Document::computeSize Created: 17/Dec/19  Updated: 29/Oct/23  Resolved: 20/Feb/20

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 4.3.4

Type: Improvement Priority: Major - P3
Reporter: Ian Boros Assignee: Svilen Mihaylov (Inactive)
Resolution: Fixed Votes: 0
Labels: neweng, qexec-team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Query 2020-02-24
Participants:

 Description   

Document::size() takes linear time. Most people (including me) expect a size() function to be constant time. We should rename this method.

 



 Comments   
Comment by Githook User [ 20/Feb/20 ]

Author:

{'username': 'smihaylov-mongodb', 'name': 'Svilen Mihaylov', 'email': 'svilen.mihaylov@mongodb.com'}

Message: SERVER-45216 Rename Document::size() to Document::computeSize
Branch: master
https://github.com/mongodb/mongo/commit/03792669b22c6d0e2785a823e5081a6125c2d37c

Comment by Ian Boros [ 17/Dec/19 ]

Today I found a workload where roughly 20% of the time is being spent in Document::size() because we assumed it was cheap to call.

Generated at Thu Feb 08 05:08:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.