Skip to content

Conversation

@sakulstra
Copy link
Contributor

@sakulstra sakulstra commented Jan 11, 2026

We have an application that indexes a huge amount of logs and when benchmarking where time is spent, i noticed that the decoding alone takes roughly 10% of the time. Therefore, i started looking into how to improve performance here.

Running against this version locally, seems to improve performance by roughly 25% for us.
Still probably there is more things to optimize.

Opening this more for discussion than to necessarily merge.
Our usecase essentially is: decoding a huge amounts of logs with a limited set of abiEvents (perhaps 20).

As i understand the bench result it's around x3 as fast?
In our realworld example (which does more things than just decoding), these are the results:

Before:

✅ Run 1 completed:
   Decoding time: 11.95s
   Total logs: 364674

After:

✅ Run 1 completed:
   Decoding time: 7.00s 
   Total logs: 364674

@changeset-bot
Copy link

changeset-bot bot commented Jan 11, 2026

🦋 Changeset detected

Latest commit: 68aaf3d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
viem Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 11, 2026

Open in StackBlitz

npm i https://pkg.pr.new/viem@4228

commit: 68aaf3d

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be happy to merge this in if it makes things faster.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For us, at least in local development it seems to speed things up quite a bit.

Wondering though if there are other things one could do.
Noble has a new major release: https://github.com/paulmillr/noble-curves/releases not sure if that helps much.
There is a pending pr that might improve things: paulmillr/noble-hashes#126

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants