Skip to content

Custom Functions that accept Entity arguments can take a long time and fail to calculate when there are many on a worksheet/book #4654

Description

@demyte

We are using streaming functions in our addin where users can pass the results of some of our other functions that produce Entity results in as arguments.

We are seeing an issue on larger workbooks where when the workbook calculates (e.g. when it is first opened) and our functions fire, any of our functions that have entity cells passed in as arguments take an excessively long time to actually hit our function code.

In the extreme example, this delay can last for 70+ seconds and then fail before we ever have our function code triggered and the following error is showing in the devtools console

image

The top of this file is as follows if it helps to understand the context of where it is going wrong:

image

I have attached a trace file Trace-20240709T165130.zip that I started and then triggered a workbook calculation about 2 seconds after. You can see that not much goes on until after 80seconds when the error above is displayed

UPDATE: See sample repo below that shows it happening

Your Environment

  • Platform [PC desktop, Mac, iOS, Office on the web]: PC Desktop
  • Host [Excel, Word, PowerPoint, etc.]: Excel
  • Office version number: Microsoft® Excel® for Microsoft 365 MSO (Version 2406 Build 16.0.17726.20078) 64-bit
  • Operating System: Windows 11 x64
  • Browser (if using Office on the web):

Expected behavior

Expectation is that these formula being passed an entity get through the Excel side of the engine to our side with the same as or close to the same performance as a standard formula with normal arguments.

Current behavior

As above... it can be exceptionally slow when there are many formula and can lead to a browser error and even Excel locking up and crashing

Steps to reproduce

  1. Using the sample
  2. Build and run it
  3. Load the example excel workbook from the repo
  4. Calculate it

Link to live example(s)

This sample is a clean yo office generated shared runtime project with only the functions updated:

Note: These two functions and workbook example work in a ScriptLab sample.

Metadata

Metadata

Labels

Area: ExcelIssue related to Excel add-insArea: custom functionsIssue related to the Excel custom functions featureNeeds: attention 👋Waiting on Microsoft to provide feedbackStatus: in backlogIssue is being tracked in the backlog but timeline for resolution is unknownType: product feature requestOffice JS ideas that should be posted to aka.ms/m365dev-suggestions (formerly User Voice.)
No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions