flatMap() vs filter().map()

flatMap vs filter map
2 years ago
User agent: Mozilla/5.0 (Linux; Android 11; Pixel 2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Mobile Safari/537.36
Test name Executions per second
filter().map() 93.7 Ops/sec
flatMap() 30.5 Ops/sec
Script Preparation code:
Tests:
  • filter().map()

  • flatMap()

Open this result on MeasureThat.net