Bug #102963 Performance issue: NativeDriver.ReadColumnValue creates RegEx for every call
Submitted: 14 Mar 2021 19:33 Modified: 15 Mar 2021 5:14
Reporter: Stefan Elstner Email Updates:
Status: Duplicate Impact on me:
Category:Connector / NET Severity:S5 (Performance)
Version:8.0.23 OS:Any
Assigned to: CPU Architecture:Any

[14 Mar 2021 19:33] Stefan Elstner
The regex that is being created on every call to ReadColumnValue is

Regex regex = new Regex(@"(?i)^[0-9A-F]{8}[-](?:[0-9A-F]{4}[-]){3}[0-9A-F]{12}$"); 

The issue is that creating the regex is already quite an expensive operation in .NET (it is being compiled). Furthermore the regex is only needed for GUID column types.

How to repeat:
Call read operations in a loop.

Suggested fix:
- Make regex static readonly
[15 Mar 2021 5:14] MySQL Verification Team
Hello Horst Tappert,

Thank you for the report and feedback.
Imho this is duplicate of Bug #101714, please see Bug #101714