因为pre-main过长,所以想借助hook_cpp_init计算下C++ static initializers的耗时,但结果更加让我迷惑了
initializer time 只需要0.9s,但SumInitTime算出来却是55.47678470611572,请问这是什么情况
`
Total pre-main time: 1.3 seconds (100.0%)
dylib loading time: 197.91 milliseconds (14.4%)
rebase/binding time: 149.23 milliseconds (10.9%)
ObjC setup time: 31.32 milliseconds (2.2%)
initializer time: 988.82 milliseconds (72.3%)
slowest intializers :
libSystem.B.dylib : 7.72 milliseconds (0.5%)
libMainThreadChecker.dylib : 38.77 milliseconds (2.8%)
libglInterpose.dylib : 565.71 milliseconds (41.3%)
xxx : 580.15 milliseconds (42.4%)
2021-02-07 21:21:37.646752+0800 xxx[58247:13175799] allinitinfo = (
"ASLR=0x104224000",
"0x10425ada4=2.408027648925781",
"0x1042b8388=0.08702278137207031",
"0x1047563b0=0.8720159530639648",
"0x104784e30=2.192974090576172",
"0x104855f24=0.08702278137207031",
"0x104a42fbc=0.04899501800537109",
"0x104ad4bf8=0.3559589385986328",
"0x105054c4c=1.742005348205566",
"0x1050b224c=0.598907470703125",
"0x1052fc91c=0.4349946975708008",
"0x10541f2e8=0.1919269561767578",
"0x1054a0e40=0.4279613494873047",
"0x1054f5e90=1.44195556640625",
"0x10575827c=0.01597404479980469",
"0x1057b4598=0.01502037048339844",
"0x1057c3c48=0.01502037048339844",
"0x1057c3cb0=0.04792213439941406",
"0x10592c978=1.612067222595215",
"0x105b474f8=0",
"0x105b77ae0=6.461977958679199",
"0x105b83214=0.3119707107543945",
"0x105b8c9f8=1.549959182739258",
"0x105b94d2c=0.3920793533325195",
"0x105ba13cc=2.676010131835938",
"0x105bb3ee4=0.4309415817260742",
"0x105bbbc5c=0.4830360412597656",
"0x105bc32a0=3.454089164733887",
"0x105c448a8=0.1039505004882812",
"0x105c61da4=0.02503395080566406",
"0x105fc0954=0.01502037048339844",
"0x106127a64=0.019073486328125",
"0x1064e0728=9.456038475036621",
"0x10654cd34=0.01692771911621094",
"0x10654d5bc=0.01299381256103516",
"0x106553464=0.01192092895507812",
"0x1065549e0=0.00095367431640625",
"0x106555c5c=0.00095367431640625",
"0x1065802d8=4.915118217468262",
"0x10658466c=4.963994026184082",
"0x106a74cc4=0.3839731216430664",
"0x106a75044=0",
"0x106a76a80=0.001072883605957031",
"0x106a77998=0",
"0x106a7ccd4=0.2620220184326172",
"0x106a7f060=0.001072883605957031",
"0x106a7f830=0",
"0x106a80980=0.01490116119384766",
"0x106a80f6c=0",
"0x106a81428=0",
"0x106a8279c=0.001072883605957031",
"0x106a82d30=0",
"0x106a83fe4=0.01490116119384766",
"0x106a846d0=0",
"0x106a84838=0",
"0x106a84aac=0",
"0x106a856a8=0",
"0x106a87494=0",
"0x106a89b2c=0.2518892288208008",
"0x106a8a4d4=0",
"0x106a90060=0.01597404479980469",
"0x106a905b4=0",
"0x106a92624=0",
"0x106a93da8=0",
"0x106a955f0=0.265955924987793",
"0x106a99588=0.01502037048339844",
"0x106a9a2a8=0.001072883605957031",
"0x106a9be60=0",
"0x106a9c230=0.01502037048339844",
"0x106a9cb54=0",
"0x106aa0480=0.3160238265991211",
"0x106aa0f20=0",
"0x106aa4568=0.01502037048339844",
"0x106aa5b2c=0",
"0x106aa6408=0.001072883605957031",
"0x106aa6710=0",
"0x106aa74e8=0",
"0x106aa83bc=0.01406669616699219",
"0x106aa9af0=0",
"0x106aabe7c=0.2599954605102539",
"0x106aac52c=0",
"0x106aad0e8=0",
"0x106ab8040=0.3379583358764648",
"0x106aba4f8=0",
"0x106abad54=0.00095367431640625",
"0x106abb580=0.001072883605957031",
"0x106abd554=0.01394748687744141",
"0x106ac21d4=0.01502037048339844",
"0x106ac3428=0",
"0x106aca598=0.2939701080322266",
"0x106aca8d4=0",
"0x106acaac4=0.00095367431640625",
"0x106acbcc8=0",
"0x106acdf8c=0.01490116119384766",
"0x106ad1510=0.01502037048339844",
"0x106ad3ef0=0",
"0x106ae164c=0.3819465637207031",
"0x106ae2eb4=0",
"0x106ae6198=0.01502037048339844",
"0x106aeb46c=0.01490116119384766",
"0x106aecb14=0.2279281616210938",
"0x106aed304=0.001072883605957031",
"0x106aedfa0=0.00095367431640625",
"0x106af11e4=0.01394748687744141",
"0x106af2424=0.001072883605957031",
"0x106af6e6c=0.01406669616699219",
"0x106af7c98=0",
"0x106af95c4=0.2200603485107422",
"0x106afb1b8=0.002026557922363281",
"0x106afbe38=0.002980232238769531",
"0x106afe19c=0.03302097320556641",
"0x106affe5c=0",
"0x106b014e0=0.01800060272216797",
"0x106b01bc0=0",
"0x106b02d68=0.001072883605957031",
"0x106b04078=0.2130270004272461",
"0x106b062b0=0.00095367431640625",
"0x106b06c28=0",
"0x106b080e4=0.01597404479980469",
"0x106b09fd4=0",
"0x106b0b2b8=0",
"0x106b0c298=0.01502037048339844",
"0x106b1075c=0.2570152282714844",
"0x106b10f4c=0",
"0x106b11728=0",
"0x106b12108=0",
"0x106b134a0=0",
"0x106b13838=0.00095367431640625",
"0x106b190a8=0.01800060272216797",
"0x106b1a668=0",
"0x106b1b2a4=0",
"0x106b1cae8=0.01394748687744141",
"0x106b1cee8=0.00095367431640625",
"0x106b1d28c=0",
"0x106b1d458=0",
"0x106b20624=0.01490116119384766",
"0x106b20f6c=0.00095367431640625",
"0x106b211ec=0.00095367431640625",
"0x106b22d40=0",
"0x106b254dc=0.01502037048339844",
"0x106b285b0=0.01394748687744141",
"0x106b28fa8=0.001072883605957031",
"0x106b296e8=0",
"0x106b2abc4=0",
"0x106b2b09c=0",
"0x106b32c70=0.01704692840576172",
"0x106b33f6c=0",
"0x106b34148=0.01299381256103516",
"0x106b34a20=0",
"0x106b3514c=0",
"0x106b3699c=0.001072883605957031",
"0x106b38534=0.01597404479980469",
"0x106b3af2c=0.001072883605957031",
"0x106b3f2e8=0.01394748687744141",
"0x106b400c4=0.01299381256103516",
"0x106b40700=0",
"0x106b41790=0.001072883605957031",
"0x106b436f4=0.00095367431640625",
"0x106b440ac=0.01311302185058594",
"0x106b444bc=0",
"0x106b48484=0.01204013824462891",
"0x106b48860=0.00095367431640625",
"0x106b4afd8=0",
"0x106b4bc14=0",
"0x106b4e490=0",
"0x106b52184=0.01597404479980469",
"0x106b541f4=0.01299381256103516",
"0x106b5a6c0=0.01597404479980469",
"0x106b5ba6c=0",
"0x106b60c78=0.01502037048339844",
"0x106b61a14=0",
"0x106b636ec=0",
"0x106b63eac=0",
"0x106b64670=0.01502037048339844",
"0x106b64cf4=0",
"0x106b66c14=0.002026557922363281",
"0x106b6724c=0.00095367431640625",
"0x106b6aa10=0.01406669616699219",
"0x106b6b010=0",
"0x106b6b944=0.001072883605957031",
"0x106b73ddc=0.02801418304443359",
"0x106b7484c=0.001072883605957031",
"0x106b752cc=0",
"0x106b76f20=0.002026557922363281",
"0x106b79df4=0.01394748687744141",
"0x106b7aaf8=0",
"0x106b7b438=0.00095367431640625",
"0x106b7cc78=0.01299381256103516",
"0x106b7d0c4=0.00095367431640625",
"0x106b7f780=0.00095367431640625",
"0x106b80748=0.01299381256103516",
"0x106b812f0=0.00095367431640625",
"0x106b87840=0.01502037048339844",
"0x106b88218=0.01299381256103516",
"0x106b90460=0.02205371856689453",
"0x106b923c4=0",
"0x106b92b4c=0",
"0x106b937f8=0.001072883605957031",
"0x106b93c0c=0",
"0x106b98df4=0.01502037048339844",
"0x106b9a92c=0",
"0x106b9b0b4=0.00095367431640625",
"0x106b9b5c8=0",
"0x106b9c8f4=0.01299381256103516",
"0x106ba1080=0.01394748687744141",
"0x106ba2758=0",
"0x106ba2c2c=0",
"0x106ba4e6c=0.00095367431640625",
"0x106ba559c=0",
"0x106ba5c3c=0",
"0x106ba6600=0",
"0x106ba7060=0",
"0x106ba7940=0.00095367431640625",
"0x106ba828c=0.01299381256103516",
"0x106ba9290=0.00095367431640625",
"0x106bac4f8=0.01502037048339844",
"0x106bad61c=0.002026557922363281",
"0x106bb07d0=0.01299381256103516",
"0x106bb0dc8=0.001072883605957031",
"0x106bb581c=0.01502037048339844",
"0x106bb6828=0",
"0x106bb7658=0.00095367431640625",
"0x106bb78a8=0.00095367431640625",
"0x106bb86a0=0.01406669616699219",
"0x106bb8b9c=0",
"0x106bbd4e8=0.01800060272216797",
"0x106bbf2c8=0",
"0x106bc3c08=0.03600120544433594",
"0x106bca574=0.01299381256103516",
"0x106bcabf0=0",
"0x106bcc560=0.001072883605957031",
"0x106bcf418=0",
"0x106bcf91c=0.00095367431640625",
"0x106bd04c0=0.01394748687744141",
"0x106bd2ce8=0",
"0x106bd3bf4=0",
"0x106bd90f4=0.01299381256103516",
"0x106bd9a7c=0.00095367431640625",
"0x106bde880=0.01597404479980469",
"0x106be4aa8=0.01502037048339844",
"0x106be8028=0.01406669616699219",
"0x106bea50c=0.001072883605957031",
"0x106beb28c=0",
"0x106bec060=0",
"0x106beccf8=0",
"0x106bf9090=0.01394748687744141",
"0x106c0fa8c=0.02503395080566406",
"0x106c0fce4=0.01394748687744141",
"0x106c10288=0.001072883605957031",
"0x106c1d13c=1.164078712463379",
"0x106c1d1a0=0.01299381256103516",
"0x106c1d20c=0.001072883605957031",
"0x106c1d28c=0",
"0x106c1d2d4=0.007987022399902344",
"0x106c1dab8=0.00095367431640625",
"0x106c248f0=0.01299381256103516",
"0x106c249ec=0.001072883605957031",
"0x106c26c64=0",
"0x106c27058=0.00095367431640625",
"0x106c3041c=0.02503395080566406",
"0x106c32c58=0",
"0x106c5f47c=0.01204013824462891",
"0x106c5f4e0=0",
"0x106c5f54c=0",
"0x106c5f5cc=0",
"0x106c60e2c=0",
"0x106c60e90=0",
"0x106c60efc=0.00095367431640625",
"0x106c60f7c=0",
"0x106c63c8c=0",
"0x106c659c0=0.01299381256103516",
"0x106c65a24=0",
"0x106c65a90=0",
"0x106c664dc=0",
"0x106c6a190=0.01204013824462891",
"0x106c6a1f4=0",
"0x106c6a260=0",
"0x106c6b9ac=0",
"0x106c6d240=0.01394748687744141",
"0x106c6f948=0",
"0x106c7759c=0.01299381256103516",
"0x106c79014=0.01192092895507812",
"0x106c79078=0",
"0x106c790e4=0",
"0x106c79164=0.00095367431640625",
"0x106c81364=0",
"0x106c81598=0",
"0x106c828f4=0",
"0x106c82958=0",
"0x106c829c4=0",
"0x106c846c4=0.01299381256103516",
"0x106c85700=0.00095367431640625",
"0x106c87048=0",
"0x106c870ac=0",
"0x106c87118=0",
"0x106c8a008=0.02491474151611328",
"0x106c8a7d4=0.001072883605957031",
"0x106c8e9b4=0.01204013824462891",
"0x106c8ea18=0",
"0x106c8ea84=0",
"0x106c98d7c=0.01299381256103516",
"0x106c98de0=0",
"0x106c98e4c=0",
"0x106c98ecc=0",
"0x106c99284=0.003933906555175781",
"0x106d0c774=0.6660223007202148",
"0x106da9bcc=0.2980232238769531",
"0x106dac0ec=0.01299381256103516",
"0x106dac150=0",
"0x106dac1bc=0",
"0x106db9b38=0.2260208129882812",
"0x106dbb684=0",
"0x106dbb6e8=0",
"0x106dbb754=0",
"0x106dbb888=0",
"0x106dc869c=0.2870559692382812",
"SumInitTime=55.47678470611572"
)
`