use array map method instead of “for” loops to iterate faster through 2-dimensional spreadsheet data.
Sourabh Choraria shares his experience of using Array.map
to find values in a Google Sheet and the performance benefit of using this approach.
Source: iterate ~80x faster through spreadsheet using map function in apps script

Member of Google Developers Experts Program for Google Workspace (Google Apps Script) and interested in supporting Google Workspace Devs.