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

Remove unnecessary clone in node update method #1274

Merged
merged 4 commits into from
Mar 31, 2024
Merged

Remove unnecessary clone in node update method #1274

merged 4 commits into from
Mar 31, 2024

Conversation

Ubitso
Copy link

@Ubitso Ubitso commented Feb 14, 2024

📝 Description

We have a lot of instances of the app, with a bunch of services.
When app starts it took too long(4 sec on average) of active node cpu workload.
I've used the node debug to find a hot spot.
That was a deepClone in update method of node.js.
It might be not necessary to clone the object because it comes from transport and it isn't used after.
I think current tests it has to be enough to prove that everything ok with the registry

💎 Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

🚦 How Has This Been Tested?

It has to be enough current tests of node-catalog

🏁 Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have commented my code, particularly in hard-to-understand areas

@Ubitso
Copy link
Author

Ubitso commented Feb 14, 2024

image

@Ubitso
Copy link
Author

Ubitso commented Feb 14, 2024

I've found cloneDeep was used to omit handler properties from services object. It breaks CBOR serializer e2e tests.

@Ubitso Ubitso changed the title Remove not necessary clone in node update method Remove unnecessary clone in node update method Feb 15, 2024
@Ubitso
Copy link
Author

Ubitso commented Feb 26, 2024

@icebob Can you look this PR, please?

Copy link
Member

@icebob icebob left a comment

Choose a reason for hiding this comment

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

Good job, thanks

@icebob icebob merged commit 0d88cca into moleculerjs:master Mar 31, 2024
177 checks passed
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