[SERVER-44401] Speed up validateBSON Created: 04/Nov/19  Updated: 29/Oct/23  Resolved: 18/Aug/20

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 4.7.0

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

Issue Links:
Problem/Incident
Related
related to SERVER-44102 Optimize bsonelement constructor Closed
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2019-11-18, Execution Team 2019-12-02, Execution Team 2019-12-16, Execution Team 2020-01-13, Execution Team 2020-01-27, Execution Team 2020-02-10, Execution Team 2019-12-30, Execution Team 2020-05-04, Execution Team 2020-08-10, Execution Team 2020-08-24
Participants:
Linked BF Score: 50

 Description   

The work to speed up validation led to improvements in the speed of iterating over BSON. Similar changes are applicable to validateBSON. Early results indicate a 2x speedup for this method is possible.



 Comments   
Comment by Githook User [ 17/Aug/20 ]

Author:

{'name': 'Geert Bosch', 'email': 'geert@mongodb.com', 'username': 'GeertBosch'}

Message: SERVER-44401 Fix CodeWScope edge cases in new BSONValidate

Pushing the special CodeWScope frame wouldn't update the _currElem, leading
nested documents and arrays to incorrectly assume they'd need special handling
as well.
Branch: master
https://github.com/mongodb/mongo/commit/4397b05e2e78cd4eb5a1b598a4f73058027436aa

Comment by Githook User [ 14/Aug/20 ]

Author:

{'name': 'Geert Bosch', 'email': 'geert@mongodb.com', 'username': 'GeertBosch'}

Message: SERVER-44401 Optimize validateBSON

This reinstates commit bf1f6cdc20e2e5122dd2749f93e45244ec1eaf2e with an additional fix to avoid
post-decrementing an iterator pointing at begin(), solving failures on Windows Debug builds.
Branch: master
https://github.com/mongodb/mongo/commit/cead094547872319d084810ee3d9fbd19a6beeb1

Comment by Githook User [ 14/Aug/20 ]

Author:

{'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}

Message: Revert "SERVER-44401 Optimize validateBSON"

This reverts commit bf1f6cdc20e2e5122dd2749f93e45244ec1eaf2e.
Branch: master
https://github.com/mongodb/mongo/commit/01cdb5943fe82be6972d6601d1c8e645e223ed3a

Comment by Githook User [ 13/Aug/20 ]

Author:

{'name': 'Geert Bosch', 'email': 'geert@mongodb.com', 'username': 'GeertBosch'}

Message: SERVER-44401 Optimize validateBSON
Branch: master
https://github.com/mongodb/mongo/commit/bf1f6cdc20e2e5122dd2749f93e45244ec1eaf2e

Comment by Githook User [ 13/Aug/20 ]

Author:

{'name': 'Geert Bosch', 'email': 'geert@mongodb.com', 'username': 'GeertBosch'}

Message: SERVER-44401 Add validate_BSON benchmark
Branch: master
https://github.com/mongodb/mongo/commit/8899de4dedcb5b44d952d84e307a7bc385fb2cfe

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