---
title: "Benchmark: Process Costs for Searching Values with TextFinder in Google Sheets using Google Apps Script"
author: "Martin Hawksey"
date: 2020-10-02T12:32:23+00:00
modified: 2020-10-02T12:35:25+00:00
canonical_url: https://pulse.appsscript.info/p/2020/10/benchmark-process-costs-for-searching-values-with-textfinder-in-google-sheets-using-google-apps-script/
markdown_url: https://pulse.appsscript.info/p/2020/10/benchmark-process-costs-for-searching-values-with-textfinder-in-google-sheets-using-google-apps-script.md
categories:
  - "Sheets"
  - "Solutions"
  - "V8"
tags:
  - "tanaikech.github.io"
featured_image: https://pulse.appsscript.info/files/2020/10/20200929a-fig2.png
description: "TextFinder is a relatively new addition to Google Apps Script which provides methods for finding or replacing text within a range, sheet or spreadsheet. There have been some reports on Stack Overflow that the TextFinder methods can be relatively slow to execute compared to using native JavaScript techniques.. This post by Tanaike explores the process time of TextFinder against other techniques."
---

# Benchmark: Process Costs for Searching Values with TextFinder in Google Sheets using Google Apps Script

![Benchmark: Process Costs for Searching Values with TextFinder in Google Sheets using Google Apps Script](https://pulse.appsscript.info/files/2020/10/20200929a-fig2.png)

> [https://tanaikech.github.io/2020/09/30/benchmark-process-costs-for-searching-values-in-spreadsheet-using-google-apps-script/](https://tanaikech.github.io/2020/09/30/benchmark-process-costs-for-searching-values-in-spreadsheet-using-google-apps-script/)
> Here, I would like to report the process costs for searching values in Spreadsheet using Google Apps Script (GAS). When the values are searched in Google Spreadsheet, the following 3 patterns can be considered. [Ref](https://stackoverflow.com/a/56663884)
> 
> Retrieve all values using `getValues`, and the values are searched from the retrieved array.
> Use TextFinder.
> Use Query language.

`[TextFinder**](https://developers.google.com/apps-script/reference/spreadsheet/text-finder)` is a relatively new addition to Google Apps Script with was [released on April 5, 2019**](https://developers.google.com/apps-script/releases/2019#april_5_2019). `TextFinder` is part of the Spreadsheet Service and provides methods for finding or replacing text within a range, sheet or spreadsheet. There have been some reports on Stack Overflow that the `TextFinder` methods can be relatively slow to execute compared to using native JavaScript techniques. This post by Tanaike explores the process time of `TextFinder` against other techniques. Click through to the source for the results and code for running the experiment.

Source: [Benchmark: Process Costs for Searching Values in Spreadsheet using Google Apps Script**](https://tanaikech.github.io/2020/09/30/benchmark-process-costs-for-searching-values-in-spreadsheet-using-google-apps-script/)

---

*Published by [Martin Hawksey](https://pulse.appsscript.info/p/author/admin/) on [Pulse](https://pulse.appsscript.info/). Original article: [https://pulse.appsscript.info/p/2020/10/benchmark-process-costs-for-searching-values-with-textfinder-in-google-sheets-using-google-apps-script/](https://pulse.appsscript.info/p/2020/10/benchmark-process-costs-for-searching-values-with-textfinder-in-google-sheets-using-google-apps-script/)*
