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

More toObject() perf improvements #14623

Merged
merged 10 commits into from
Jun 2, 2024
Merged

More toObject() perf improvements #14623

merged 10 commits into from
Jun 2, 2024

Conversation

vkarpov15
Copy link
Collaborator

Summary

#14606 caused some performance regression because options is 3rd param to get(), not 2nd.

Also did some work to remove cloneOptions in favor of just plain old options, and relying more on _calledWithOptions to handle the distinction between options that the user specified in the toObject() / toJSON() function call vs options that are set from the schema or mongoose global

Examples

@andrews05
Copy link
Contributor

#14606 caused some performance regression because options is 3rd param to get(), not 2nd.

In my defence... "It was like that when I got here!" 😄

Copy link
Collaborator

@hasezoey hasezoey left a comment

Choose a reason for hiding this comment

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

LGTM, one question though

lib/document.js Show resolved Hide resolved
@vkarpov15
Copy link
Collaborator Author

@andrews05 no need to apologize, it's our fault, we should've caught that in code review.

vkarpov15 added a commit that referenced this pull request May 31, 2024
remove old benchmarks, add new benchmark for #14394
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