Changes between Initial Version and Version 1 of Ticket #854, comment 11
- Timestamp:
- 03/09/17 08:10:46 (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #854, comment 11
initial v1 9 9 > Is that strlen() truly needed? Okay, I see the argument of being explicit what the length refers to. But how will this hit the performance? Will the compiler be smart enough to optimize this not to call strlen() for each iteration? 10 10 11 No, it will not. Both gcc and clang with -O2 do not emit any calls to strlen(). See for example the following intermixed assembly generated by gcc:11 Yes, compilers are smart enough to optimize the strlen() calls away. Both gcc and clang with -O2 do not emit any calls to strlen(). See for example the following intermixed assembly generated by gcc: 12 12 13 13 {{{