ChainSafe / lodestar

🌟 TypeScript Implementation of Ethereum Consensus
https://lodestar.chainsafe.io
Apache License 2.0
1.18k stars 289 forks source link

gindexIterator() is hot #2458

Closed dapplion closed 3 years ago

dapplion commented 3 years ago

Describe the bug

gindexIterator()showed in the profile as one of the most expensive self functions. Time listed here represents 5% of total CPU time. See source of the file:

app/node_modules/@chainsafe/persistent-merkle-tree/lib/gindex.js

Screenshot from 2021-05-01 16-22-19

Maybe is there a cheaper way to iterate than using this iterators?

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 15 days if no further activity occurs. Thank you for your contributions.

dapplion commented 3 years ago

@wemeetagain Could you take a look?

dapplion commented 3 years ago

Deprecated this function with latest ssz release