https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116743
--- Comment #18 from Eugene Rozenfeld <erozen at microsoft dot com> --- Hi Rama. I started looking at this. Below is what the info looks like for ha_innobase::build_template in the gcov file you shared. If you look near the end, you can see counts for calls to build_template_needs_field_in_icp but nothing for the basic blocks that call build_template_needs_field. This is probably why the compiler thinks that calls to build_template_needs_field are unlikely and decides not to inline them. Is this gcov file generated by profiling the same scenario that you then use to get your throughput numbers? _ZN11ha_innobase14build_templateEb total:66636 head:0 0: 986 4: 103 5: 22 8: 68 13: 0 14: 1288 15: 1383 19: 0 27: 0 31: 162 46.2: 30 48.2: 33 48.4: 163 57.4: 916 59.4: 498 60: 0 61: 0 69: 202 71: 816 74: 1461 75: 1143 76: 1384 77: 67 78: 266 83: 76 83.1: 63 84: 27 87: 107 87.2: 35 90: 434 90.1: 0 91: 0 94: 184 112: 307 112.1: 0 113: 164 119: 18 120: 0 122: 39 123: 15 125: 1 126: 13 133: 9 138: 17 143: 122 169: 150 169.1: 0 170.1: 0 177: 0 181: 2 181.2: 77 185: 347 185.1: 0 186: 0 189: 167 192: 250 192.1: 0 194: 128 199: 12 200: 8 202: 33 203: 42 205: 2 206: 106 206.1: 0 207.1: 0 213: 10 216: 34 217: 12 222: 2 225: 82 227: 58 229: 60 229.2: 753 231: 13252 231.1: 0 233: 3813 240: 343 240.1: 0 240.3: 0 241.3: 0 244: 0 245: 0 246: 0 249: 0 254: 0 256: 574 259: 839 260: 760 262: 363 264: 0 270: 1287 276: 3074 277: 11192 279: 475 280: 0 283: 10535 284: 522 289: 191 289.1: 62 292: 43 292.3: 45 295.3: 71 298: 875 59611: 0 44: _ZN12dict_table_t11first_indexEv total:70 2: _ZNK12dict_table_t11first_indexEv total:70 2: 70 60: _ZN2ut14malloc_withkeyENS_16PSI_memory_key_tEm total:0 3: _ZN2ut6detail6Alloc_INS0_9Alloc_pfsEE5allocILb0ES2_EENSt9enable_ifIXsrT0_21is_pfs_instrumented_vEPvE4typeEmj total:0 1: _ZN2ut6detail9Alloc_pfs5allocILb0EEEPvmj total:0 2: 0 4: 0 10: 0 21: 0 8199: 0 3: _ZN2ut6detail8Alloc_fn5allocILb0EEEPvm total:0 4: _ZN2ut6detail8Alloc_fn6mallocEm total:0 0: _ZN2ut6detail6mallocEm total:0 0: 0 15: _ZN2ut6detail12PFS_metadata17pfs_owning_threadEPvP10PSI_thread total:0 2: 0 16: _ZN2ut6detail12PFS_metadata11pfs_datalenEPvm total:0 3: 0 17: _ZN2ut6detail12PFS_metadata7pfs_keyEPvj total:0 2: 0 18: _ZN2ut6detail12PFS_metadata14pfs_metaoffsetEPvm total:0 3: 0 113: _Z33build_template_needs_field_in_icpPK12dict_index_tPK14row_prebuilt_tbmb total:25 11.4: 25 12: 0 194: _Z33build_template_needs_field_in_icpPK12dict_index_tPK14row_prebuilt_tbmb total:33 11.4: 33 12: 0 277: _ZNK12dict_index_t12is_clusteredEv total:3235 3: 3235