Skip to content

Conversation

@webNeat
Copy link
Contributor

@webNeat webNeat commented Apr 4, 2024

Hello @TkDodo

This is my attempt to fix the issue #6489 by improving the performance of asyncThrottle

Here is the code of a simple benchmark I did https://gist.github.com/webNeat/d4444931e0d2d37502815c6e7b0b6a1e

The results on my machine (running with Node):

The avg time it takes in milliseconds to run 1_000_000 times
old version: 127
new version: 19

I didn't add any new tests because I kept the exact same behavior as before.

Let me know what you think about this implementation.

@vercel
Copy link

vercel bot commented Apr 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
query ⬜️ Ignored (Inspect) Visit Preview Apr 8, 2024 7:39am

@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 4, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit c66a0fa:

Sandbox Source
@tanstack/query-example-angular-basic Configuration
@tanstack/query-example-react-basic-typescript Configuration
@tanstack/query-example-solid-basic-typescript Configuration
@tanstack/query-example-svelte-basic Configuration
@tanstack/query-example-vue-basic Configuration

@nx-cloud
Copy link

nx-cloud bot commented Apr 8, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit c66a0fa. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 2 targets

Sent with 💌 from NxCloud.

Copy link
Collaborator

@TkDodo TkDodo left a comment

Choose a reason for hiding this comment

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

nice work 👏 . I trust the test coverage here, if everything is still green, I'll merge this

@TkDodo TkDodo merged commit 39909c4 into TanStack:main Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Performance issue in @tanstack/query-async-storage-persister (and possibly #updateStaleTimeout)

2 participants