Change utils deprecated methods to alternative approaches #18707
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.
Hello all,
Today I was reading the
api/util
documentation and so many methods with the flagdeprecate
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 filebenchmark/misc/util-extend-vs-object-assign.js
which i ran and the output is this: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.
The text was updated successfully, but these errors were encountered: