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

Don't use Array.shift in custom deserializers #1364

Merged
merged 2 commits into from
Mar 21, 2025
Merged

Conversation

mdumandag
Copy link
Contributor

@mdumandag mdumandag commented Mar 21, 2025

It is not a O(1) operation in Node.js (V8 engine). So, custom deserializers that were using it extensively like hgetall was running extremely slow on large payloads.

We are now using plain indexing to achieve the same thing.

@mdumandag mdumandag changed the title Don't use Array.shift in custom serializers Don't use Array.shift in custom deserializers Mar 21, 2025
It is not a O(1) operation in Node.js (V8 engine). So, custom deserializers
that were using it extensively like hgetall was running extremely slow
on large payloads.

We are now using plain indexing to achieve the same thing.
@mdumandag mdumandag force-pushed the dont-use-array-shift branch from 32508bb to 8ff9b9b Compare March 21, 2025 10:05
@mdumandag mdumandag merged commit 8154476 into main Mar 21, 2025
14 checks passed
@mdumandag mdumandag deleted the dont-use-array-shift branch March 21, 2025 10:40
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