Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Improve comparison performance #2973

Merged
merged 1 commit into from
May 31, 2024
Merged

fix: Improve comparison performance #2973

merged 1 commit into from
May 31, 2024

Conversation

shuding
Copy link
Member

@shuding shuding commented May 31, 2024

Currently, we are using the stableHash utility (that we use for hashing resource keys) to handle the deep comparison task which is a great code reuse. However, in the worse case it might be a performance bottleneck when the payload is a large object but different from the previous data, as comparison cannot be done during the traversal.

This PR re-introduces dequal/lite as a dependency and uses that for comparison instead.

@shuding shuding requested a review from huozhi as a code owner May 31, 2024 23:50
Copy link

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/dequal@2.0.3 None 0 14.2 kB lukeed

View full report↗︎

Copy link

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.

@shuding shuding merged commit b2126a6 into main May 31, 2024
7 checks passed
@shuding shuding deleted the shu/cwlj branch May 31, 2024 23:56
kimdaeyeub pushed a commit to kimdaeyeub/swr that referenced this pull request Jun 21, 2024
use deep comparison instead of hashing the fetch body
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