[SERVER-55482] Improve BucketCatalog::MinMax algorithm Created: 24/Mar/21  Updated: 29/Oct/23  Resolved: 07/Apr/21

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

Type: Task Priority: Major - P3
Reporter: Dan Larkin-York Assignee: Henrik Edin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Issue split
split from SERVER-55350 Investigate single-threaded timeserie... Closed
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2021-04-19
Participants:

 Description   

Currently we can spend a great deal of time maintaining the MinMax in timeseries bucket operations. This algorithm can likely be improved so the cost shrinks.



 Comments   
Comment by Githook User [ 07/Apr/21 ]

Author:

{'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}

Message: SERVER-55482 Optimize timeseries minmax calculation algorithm

  • Only traverse inserted object once, calculate both min and max at the same time
  • Allow inlining of comparator when possible
  • Reuse buffer to store values if buffer size is sufficient
  • Don't store field name in value as it is already stored in map owning MinMax object.

Overall this should cut CPU usage in about half.
Branch: master
https://github.com/mongodb/mongo/commit/659a367887558c4ed71bead6e1da9b5a5fe3d84b

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