Copying data; mapping vs. spreading then modifying vs. Object.assign then modifiying

one month ago
User agent: Mozilla/5.0 (X11; Linux x86_64; rv:101.0) Gecko/20100101 Firefox/101.0
Test name Executions per second
Mapping 16935210.0 Ops/sec
spreading, then modifying 8021250.0 Ops/sec
Object.assign, then modifying 1541070.0 Ops/sec
Script Preparation code:
Tests:
  • Mapping

  • spreading, then modifying

  • Object.assign, then modifying

Open this result on MeasureThat.net