Bug #106720 it is better to make a conditional judgment before entering the while loop
Submitted: 13 Mar 2022 13:55 Modified: 14 Mar 2022 5:37
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

[13 Mar 2022 13:55] alex xing
Description:
it is better to make a conditional judgment before entering the while loop in btr_print_recursive, which reduces the times of judgments and is more CPU-friendly

How to repeat:
just read the code

Suggested fix:
make a conditional judgment before entering the while loop just as the below patch
[13 Mar 2022 13:56] 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: optimize.patch (text/plain), 1.55 KiB.

[14 Mar 2022 5:37] MySQL Verification Team
Hello Alex Xing,

Thank you for the report and contribution.

regards,
Umesh