Recently the Google Apps Script method [range].getValues()
has stopped performing as quickly as it used to. Now it is sluggish to the tune of taking about 10 seconds to either .getValue()
of a single cell range or .getValues()
of a multi-cell range. I'm sure we will just have to wait for Google to fix the issue but I use this so much it's causing some issues in some of my programmatic work-flow.
What I have tried so far:
- Switching back and forth between V8 and the previous version -- no improvement
- Obtaining the range object in A1 notation vs. Column / Row - no improvement
- Running the function separately from any other code -- no improvement
EDIT:
This appears to be related to the issues in this bug tracker with Google Apps Script: https://issuetracker.google.com/issues/222342099
As of March 3rd, 2022 at 5:00 CST this issue appears to have been resolved in regard to the [range].getValue()
and the [range].getValues()
methods, which has nothing to do with the issue that was referenced in the link when the question was erroneously closed.
In a comment it was recommended that I include a code example so I will elaborate on the code example I had in the original question to simply expand on my code example provided in the original question:
function slow_code() {
var value = SpreadsheetApp.getActiveSpreadsheet().getRange([anyrange]).getValues()
}