bnb-chain / op-geth

GNU Lesser General Public License v3.0
58 stars 47 forks source link

Reuse big.Int objects for GC optimization #172

Open andyzhang2023 opened 2 months ago

andyzhang2023 commented 2 months ago

Description

Reuse the big.Int objects on the "hot path", to decrease the GC pressure. The key functions are:

  1. effectiveGasTipValue()
  2. Transaction.Cost()
  3. newL1CostFuncEcotone()
  4. SubmitTransaction API
  5. buyGas()

It's notable that the function effectiveGasTipValue() might not be a "hot path" anymore after the "reheap optimization".