Avatar for the thirdweb-dev user
thirdweb-dev
js
BlogDocsChangelog

[Refactor] Simplify RPC client map key usage in getRpcClient function

#3805Merged
Comparing
refactor/rpc-client-map-usage
(
5c9af85
) with
main
(
cb616f7
)
CodSpeed Performance Gauge
0%
Improvements
0
Regressions
0
Untouched
9
New
0
Dropped
0
Ignored
0

Benchmarks

Passed

encode tx (json abi)
packages/thirdweb/src/transaction/actions/encode.bench.ts::encode tx (json abi)
CodSpeed Performance Gauge
0%
320.4 µs
320 µs
units:toUnits("40", 18)
packages/thirdweb/src/utils/units.bench.ts::units:toUnits("40", 18)
CodSpeed Performance Gauge
0%
34.1 µs
34.1 µs
units:toTokens(12345678901234567890n, 18)
packages/thirdweb/src/utils/units.bench.ts::units:toTokens(12345678901234567890n, 18)
CodSpeed Performance Gauge
0%
25.3 µs
25.3 µs
units:toUnits("40.0", 18)
packages/thirdweb/src/utils/units.bench.ts::units:toUnits("40.0", 18)
CodSpeed Performance Gauge
0%
34.6 µs
34.7 µs
units:toTokens(40000000000000000000n, 18)
packages/thirdweb/src/utils/units.bench.ts::units:toTokens(40000000000000000000n, 18)
CodSpeed Performance Gauge
0%
184.8 µs
185.2 µs
keccakId
packages/thirdweb/src/utils/any-evm/keccak-id.bench.ts::keccakId
CodSpeed Performance Gauge
0%
1.3 ms
1.3 ms
encode tx (human readable)
packages/thirdweb/src/transaction/actions/encode.bench.ts::encode tx (human readable)
CodSpeed Performance Gauge
0%
527.2 µs
528.9 µs
encode tx (prepared method)
packages/thirdweb/src/transaction/actions/encode.bench.ts::encode tx (prepared method)
CodSpeed Performance Gauge
-1%
475.7 µs
478.8 µs
encode tx (contract abi)
packages/thirdweb/src/transaction/actions/encode.bench.ts::encode tx (contract abi)
CodSpeed Performance Gauge
-2%
530.1 µs
538.5 µs

Commits

Click on a commit to change the comparison range
Base
main
cb616f7
0%
[Refactor] Simplify RPC client map key usage in getRpcClient function (#3805) ### TL;DR Fixes an issue with RPC client reuse to improve performance. ### What changed? The change replaces the use of `chainId` with `rpcUrl` as the key in the `rpcClientMap` to ensure the correct RPC client is reused. ### How to test? Test by running existing unit tests and functional tests for RPC client related functionality. Ensure that performance metrics show improvement in RPC client reuse scenarios. ### Why make this change? This change is motivated by the need to improve performance by ensuring the RPC client is correctly reused. ---
5c9af85
1 year ago
by jnsdls
© 2025 CodSpeed Technology
Home Terms Privacy Docs