Bug #97471 | Function passing std::vector<> by value could be sightly improved | ||
---|---|---|---|
Submitted: | 4 Nov 2019 13:53 | Modified: | 7 Nov 2019 14:41 |
Reporter: | Xing Ai (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Compiling | Severity: | S3 (Non-critical) |
Version: | 8.0 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[4 Nov 2019 13:53]
Xing Ai
[5 Nov 2019 13:04]
MySQL Verification Team
Hi Mr. Ai, Thank you for your bug report. I think that you have a point here, but we need more info. Since you quote line numbers, we need the exact release that you are referring to. Next, can you check whether 8.0.18 has the same small deficiency ???? Next, I do not think that client side is critical, since, it is basically single threaded. Lastly, could you point to any method in the server that does similar function as any of those server functions, which uses a pass-by-reference instead of pass-by-value ???
[6 Nov 2019 9:57]
Jon Olav Hauglid
Hi and thanks for the bug report! I have looked at the code and there are indeed some room for improvements here.
[6 Nov 2019 17:40]
Xing Ai
Thanks Sinisa and Jon for looking into the bug. Sorry I am not sure what is the latest code tree of MySQL, but the links I gave should have the path and line information for those listed files even if you look at them in the latest code tree. Most of the codes have good coding styles for passing std::vector<> as const reference or pointer for performance reason, but there are still a few cases left behind. If you scan and review the server codes (Not including the extra or third parties codes), you will find many similar cases that pass "std::string" as value, which may need improve as well.
[7 Nov 2019 12:41]
MySQL Verification Team
It is a minor effort to provide a full release of the server where these objects have been passed by value. However, it would save us some time and would lead to the better and faster handling of this report.
[7 Nov 2019 14:41]
Paul DuBois
Posted by developer: Fixed in 8.0.19. Code cleanup. No changelog entry required.
[7 Nov 2019 18:31]
MySQL Verification Team
Thank you, Paul ......