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

perf(utils): fast prepareValue #3370

Merged
merged 4 commits into from
Feb 10, 2025
Merged

perf(utils): fast prepareValue #3370

merged 4 commits into from
Feb 10, 2025

Conversation

cesco69
Copy link
Contributor

@cesco69 cesco69 commented Feb 6, 2025

This PR add a performance improvements at prepareValue for non-object value by skipping useless condition

On number/string/boolean

Master 357,250 ops/s
PR     740,050 ops/s

On object/array/date/buffer

Master 274,180 ops/s
PR     241,150 ops/s

Benchmark

This PR add a performance improvements at prepare Value for non-object by skipping useless condition
Copy link
Collaborator

@charmander charmander left a comment

Choose a reason for hiding this comment

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

I can’t reproduce those benchmark numbers with that link. Microbenchmarks can be misleading and that website seems unreliable. Like #3372, it’s fine as just cleanup anyway, though.

packages/pg/lib/utils.js Outdated Show resolved Hide resolved
@brianc
Copy link
Owner

brianc commented Feb 10, 2025

Looks good to me! thanks for this. 😄

@brianc brianc merged commit 751e741 into brianc:master Feb 10, 2025
5 checks passed
@cesco69 cesco69 deleted the patch-3 branch February 11, 2025 07:44
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