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

Change utils deprecated methods to alternative approaches #18707

Closed
jvelezpo opened this issue Feb 11, 2018 · 4 comments
Closed

Change utils deprecated methods to alternative approaches #18707

jvelezpo opened this issue Feb 11, 2018 · 4 comments
Labels
performance Issues and PRs related to the performance of Node.js. question Issues that look for answers. util Issues and PRs related to the built-in util module. v8 engine Issues and PRs related to the V8 dependency.

Comments

@jvelezpo
Copy link
Contributor

Hello all,

Today I was reading the api/util documentation and so many methods with the flag deprecate then i though it would be cool to find the deprecated methods in the core and change them to alternative approaches.

Following this line of thoughts i started by the first method which is util._extend and i did some changes in the code, and while doing that i found this file benchmark/misc/util-extend-vs-object-assign.js which i ran and the output is this:

image

So i find it very odd to see that a deprecated method runs faster than the official JS method Object.assign().

So please if someone could help me understand why this happen it would be great.
And also if i am missing something and the changes i am proposing make sense to the core, then i will be more than happy to go and replace deprecated methods for alternative approaches.

@vsemozhetbyt vsemozhetbyt added util Issues and PRs related to the built-in util module. v8 engine Issues and PRs related to the V8 dependency. question Issues that look for answers. labels Feb 11, 2018
@vsemozhetbyt
Copy link
Contributor

Refs: #18442

cc @nodejs/v8

@jvelezpo
Copy link
Contributor Author

Thanks for your reply @vsemozhetbyt 👍
What about the rest of the deprecated methods in util?

@BridgeAR
Copy link
Member

@jvelezpo I am not sure what you mean with that? If a method gets deprecated, it will either get a replacement right away or no replacement at all because non is needed.

Should this still be kept open? Because I am not sure what should be changed here?

@jvelezpo
Copy link
Contributor Author

I think we can close it @BridgeAR
my 2 questions were answered already
first was about util._extend
and the second was abut any other deprecated method that you answered by it will either get a replacement right away or no replacement at all because non is needed.

Thanks.

@vsemozhetbyt vsemozhetbyt added the performance Issues and PRs related to the performance of Node.js. label Feb 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Issues and PRs related to the performance of Node.js. question Issues that look for answers. util Issues and PRs related to the built-in util module. v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

No branches or pull requests

3 participants