Skip to content

Conversation

@stopachka
Copy link
Contributor

@stopachka stopachka commented Sep 19, 2024

Immer autofreezes objects. When the object is really large, this gets more and more costly. I switched us to mutative, which does not rely on auto-freeze. They have a comparison about immer vs mutative here.

I made a bunch of transactions in our perf tester.

Before
many_tx_immer.json

A single transaction ontop of the bench query on immer is about 8ms. As you add more pending transactions, it grows to about 40ms.
image

After
many_tx_mutative.json

Mutative is about 3ms on a single transaction. As I add more pending transactions, the size seems to stay at 3ms!

CleanShot 2024-09-19 at 12 10 26@2x

@dwwoelfel @markyfyi @nezaj

@github-actions
Copy link
Contributor

View Vercel preview at instant-www-js-perf3-jsv.vercel.app.

Copy link
Contributor

@dwwoelfel dwwoelfel left a comment

Choose a reason for hiding this comment

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

LGTM!

@stopachka stopachka merged commit 1016802 into main Sep 19, 2024
20 checks passed
@stopachka stopachka deleted the perf3 branch September 19, 2024 19:37
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.

3 participants