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: avoid deep copying unnecessarily in current #48

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

francescotescari
Copy link
Contributor

Fix for #47

Avoids creating a copy of all the nested objects when invoking current by lazily computing the copy of non-draft objects, only if necessary.

Performance seems to be still worse than just create (aka finalize), but at least it avoids creating new objects when unnecessary.

@unadlib
Copy link
Owner

unadlib commented Jul 23, 2024

hi @francescotescari , thank you for submitting the PR to improve performance.

Although using Symbol for marking is ok, I think it would be more appropriate to directly use object references to handle it. Nevertheless, I'm very grateful for your PR, and I will merge it.

@unadlib unadlib merged commit aadbe1e into unadlib:main Jul 23, 2024
1 check failed
@francescotescari
Copy link
Contributor Author

Although using Symbol for marking is ok, I think it would be more appropriate to directly use object references to handle it.

Good point. I was blind not seeing that :D
Opened a follow up if you mind

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