[SERVER-50894] prefer pcrecpp to std::regex Created: 11/Sep/20  Updated: 29/Oct/23  Resolved: 12/Sep/20

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 4.8.0

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:
Problem/Incident
Related
related to SERVER-66646 don't use regex for UUID::isUUIDString Closed
Backwards Compatibility: Fully Compatible
Sprint: Service arch 2020-09-21
Participants:
Linked BF Score: 0

 Description   

std::regex has extremely poor performance and cannot be improved due to ABI compatibility with its header-only implementation. It's also very bloated. Including its header brings in 20,000+ lines of C++. We're using pcrecpp for most regex work, and having a second implementation isn't necessary.



 Comments   
Comment by Githook User [ 12/Sep/20 ]

Author:

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

Message: SERVER-50894 convert std::regex to pcrecpp::RE
Branch: master
https://github.com/mongodb/mongo/commit/e0ee9c97a8c572a8e513ad8c097a5c867d34222b

Comment by Billy Donahue [ 11/Sep/20 ]

This is a single-sweep cleanup. Should consider adding a soft ban on <regex> and std::regex via lint.

Comment by Billy Donahue [ 11/Sep/20 ]

CR https://mongodbcr.appspot.com/635520001/

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