flatMap() vs filter().map()

flatMap vs filter map
one year ago
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/113.0
Test name Executions per second
filter().map() 643.6 Ops/sec
flatMap() 626.9 Ops/sec
Script Preparation code:
Tests:
  • filter().map()

  • flatMap()

Open this result on MeasureThat.net