/node-object-spread-benchmark

Object.assign vs Object Spread in Node.js v10.16.3

Primary LanguageJavaScript

Object.assign vs Object Spread in Node.js

Test it yourself:

  1. clone the repo
  2. run installation using yarn
  3. run npm start

Up to this day, using Node.js v10.16.3 - you'll get the output:

Object spread x 3,003,908 ops/sec ±1.32% (88 runs sampled)
Object.assign() x 24,988,830 ops/sec ±1.18% (88 runs sampled)
Object.assign() is faster 🤯