Uniswap / v3-subgraph

Subgraph for Uniswap V3
GNU General Public License v3.0
338 stars 464 forks source link

feat: use fast exponentiation for better perf #211

Closed IvanVergiliev closed 5 months ago

IvanVergiliev commented 5 months ago

This PR replaces two functions that cause a lot of slowness due to running a lot of BigDecimal operations with more efficient versions.

A possible further optimization to the fastExponentiation is to expose that as a WebAssembly host function at the graph-node level. This should help optimize performance further by removing the need to pass BigDecimal values back and forth between the AssemblyScript handler function and the Rust BigDecimal.times host function.