Keats / tera2

37 stars 5 forks source link

feat: Avoid std::fmt machinery where possible #19

Closed jalil-salame closed 10 months ago

jalil-salame commented 10 months ago

Looks to be an instruction perf win over the board:

iai_templates::templates::render teams:teams_setup()
  Instructions:               34396|39255           (-12.3780%) [-1.14127x]
  L1 Hits:                    48685|56277           (-13.4904%) [-1.15594x]
  L2 Hits:                       29|38              (-23.6842%) [-1.31034x]
  RAM Hits:                     344|381             (-9.71129%) [-1.10756x]
  Total read+write:           49058|56696           (-13.4718%) [-1.15569x]
  Estimated Cycles:           60870|69802           (-12.7962%) [-1.14674x]
iai_templates::templates::render big_table:big_table_setup()
  Instructions:             6669990|12080468        (-44.7870%) [-1.81117x]
  L1 Hits:                 10067825|18575012        (-45.7991%) [-1.84499x]
  L2 Hits:                    12260|12282           (-0.17912%) [-1.00179x]
  RAM Hits:                    1979|2008            (-1.44422%) [-1.01465x]
  Total read+write:        10082064|18589302        (-45.7642%) [-1.84380x]
  Estimated Cycles:        10198390|18706702        (-45.4827%) [-1.83428x]
iai_templates::templates::render realistic:realistic_setup()
  Instructions:              187747|206193          (-8.94599%) [-1.09825x]
  L1 Hits:                   260913|289793          (-9.96573%) [-1.11069x]
  L2 Hits:                      510|513             (-0.58480%) [-1.00588x]
  RAM Hits:                     684|706             (-3.11615%) [-1.03216x]
  Total read+write:          262107|291012          (-9.93258%) [-1.11028x]
  Estimated Cycles:          287403|317068          (-9.35604%) [-1.10322x]
iai_templates::templates::context big_context:big_context_setup()
  Instructions:              490359|491400          (-0.21184%) [-1.00212x]
  L1 Hits:                   684141|685723          (-0.23071%) [-1.00231x]
  L2 Hits:                     5288|5333            (-0.84380%) [-1.00851x]
  RAM Hits:                     181|167             (+8.38323%) [+1.08383x]
  Total read+write:          689610|691223          (-0.23335%) [-1.00234x]
  Estimated Cycles:          716916|718233          (-0.18337%) [-1.00184x]
     Running benches/iai-value.rs (target/release/deps/iai_value-452022e514e9078a)
iai_value::serialize::serialize_value page:& Page :: default()
  Instructions:                7859|7876            (-0.21585%) [-1.00216x]
  L1 Hits:                    10762|10781           (-0.17624%) [-1.00177x]
  L2 Hits:                        4|3               (+33.3333%) [+1.33333x]
  RAM Hits:                     136|138             (-1.44928%) [-1.01471x]
  Total read+write:           10902|10922           (-0.18312%) [-1.00183x]
  Estimated Cycles:           15542|15626           (-0.53757%) [-1.00540x]
Keats commented 10 months ago

Thanks. I'll probably change a bit the features later but that's some solid improvement!