The performance of this API is bad, and i opened a issue here: [Bug][API] `estimate_gas_price` API has performance issue · Issue #4486 · aptos-labs/aptos-core · GitHub
I looked into the
estimate_gas_price API implement code, here’s my thoughts about the cause:
GasEstimationCachecache will be always missing
Because the code does not update
last_updated_versionwhen updating the cache, so the cache hit condition will never be satisfied.
Because of cache missed, all requests need to compete for the write lock of
GasEstimationCacheto continue, which will also effect the performance