Bug #105245 no need to create recv_sys when mysqld initialize
Submitted: 18 Oct 2021 6:41 Modified: 18 Oct 2021 7:41
Reporter: alex xing (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S5 (Performance)
Version:8.0.26 OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution

[18 Oct 2021 6:41] alex xing
Description:
in srv_start, the original logic : do recv_sys_create() recv_sys_init(), and then recv_sys_free() if create_new_db=1
in my opinion, it is better to skip recv_sys_create() and  recv_sys_init() if create_new_db=1 which can reduce extra expense caused by memory allocation and destruction.

How to repeat:
just read the code

Suggested fix:
judge create_new_db in advance
[18 Oct 2021 6:42] alex xing
a simple patch to describe the optimization

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: commit.patch (text/plain), 1.40 KiB.

[18 Oct 2021 6:43] alex xing
The previous  patch is inaccurate

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: optimize.patch (text/plain), 892 bytes.

[18 Oct 2021 7:41] MySQL Verification Team
Hello Alex Xing,

Thank you for the report and contribution.

regards,
Umesh