Moving logic to one place allows to remove a branch on `using_sso()`. Side effect: `.strtab` section increases in size (to store function names), `.text` section reduces in size (less inlined code). ``` name old time/op new time/op delta BM_RepeatedPtrField_Add_Sso 11.0ns ± 4% 10.4ns ± 7% -5.71% (p=0.000 n=83+85) BM_RepeatedPtrField_Add_FallbackToRep 21.8ns ± 4% 20.8ns ± 5% -4.55% (p=0.000 n=80+83) BM_RepeatedPtrField_Add_Small 17.3ns ± 4% 15.8ns ± 5% -8.86% (p=0.000 n=78+85) BM_RepeatedPtrField_Add_Large 22.6ns ±12% 21.1ns ±10% -6.62% (p=0.000 n=100+92) BM_RepeatedPtrField_Add_HasCleared 4.15ns ±11% 4.43ns ± 6% +6.67% (p=0.000 n=82+87) BM_RepeatedPtrField_AddAllocated 12.0ns ±19% 12.0ns ±14% ~ (p=0.678 n=92+96) name old INSTRUCTIONS/op new INSTRUCTIONS/op delta BM_RepeatedPtrField_Add_Sso 101 ± 1% 88 ± 2% -13.05% (p=0.000 n=100+100) BM_RepeatedPtrField_Add_FallbackToRep 222 ± 1% 206 ± 1% -7.35% (p=0.000 n=100+100) BM_RepeatedPtrField_Add_Small 180 ± 0% 164 ± 1% -8.69% (p=0.000 n=100+100) BM_RepeatedPtrField_Add_Large 110 ± 0% 100 ± 0% -9.07% (p=0.000 n=100+99) BM_RepeatedPtrField_Add_HasCleared 27.6 ± 1% 36.6 ± 1% +32.44% (p=0.000 n=100+100) BM_RepeatedPtrField_AddAllocated 114 ± 7% 115 ±11% +0.95% (p=0.007 n=100+100) ``` PiperOrigin-RevId: 572634616pull/14363/head
parent
fdcb5d17b9
commit
1df8ea4988
2 changed files with 42 additions and 2 deletions
Loading…
Reference in new issue