wevm/abitype

Noticeably slow type inference, especially when using `createTestClient` and `.extend`

Closed this issue · 2 comments

Describe the bug

I am creating a test client with both public and wallet actions and what I expect is type inference to be relatively fast. What actually is happening is that on my M2 Ultra Max it takes 2s or more to load the client's properties and function arguments. I'd like to clarify that this isn't just using createTestClient().extend(), there are noticeably slow types in other places such as the wallet client itself but it's bearable.

Originally a discussion but after creating a reproduction and seeing that it can take over 5s (in some cases 10s), I figured it's worth an issue.

Link to Minimal Reproducible Example

https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBAbzgYygUwIYzQFTQZxgGEAbYNAOxgBo4ALGGMWsAVwCMzkBBZGYCBXy0A7hhIk0MXv0H44AXzgAzKBBBwA5ADdyITQG4AUKEixEKiKwoATKAE9FKtRp16A9MjoZgQw0aNkOXhkMkp4AF4UdCxcAmIwqgAKBCM4FG9fAC5Lazt7ajS4EAgbNBzNDApdEk1C9JgoKvwzGByGJiSASkKFLqKAOjQAD2xbJLZOYB4+ASF+9KHRyhsksQkpGTn8LuMjd3c4AGUYDHMYezBfAHM4AANQ8ioBu7gB97gqmzhGx1Z8G6fCiOZTWWaCOAiYAwOifKDXfADIxAA

Steps To Reproduce

Stackblitz reproduction (10s slow types): https://stackblitz.com/edit/stackblitz-starters-bdo9jm?file=index.ts

Package Version

^2.12.5

TypeScript Version

^5.4.5

Check existing issues

Anything else?

No response

Unfortunately didn't realize this was the abitype repo, sorry moving to viem.

This issue has been locked since it has been closed for more than 14 days.

If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest ABIType version. If you have any questions or comments you can create a new discussion thread.