Share via

Excelscript performance testing

Brenno Oliveira 20 Reputation points
2023-10-04T03:45:24.9733333+00:00

Hey! I am working on an ExcelScript that extracts data, processes it and generates multiple reports on new worksheets. I've been trying to optimize it for performance but it seems like when I re-run the same script multiple times on the same Spreadsheet the code executes faster compared to the first run (without any alterations to the code). Is there some sort of caching or other trickery at work here? I've found it difficult to benchmark performance when this type of thing happens.

Microsoft 365 and Office | Development | Other
Microsoft 365 and Office | Excel | For business | Windows
0 comments No comments

Answer accepted by question author

Yutao Huang - MSFT 701 Reputation points Microsoft Employee
2023-10-04T05:50:47.34+00:00

That's a very good observation also a great question!

Yes, if there has been no script execution for a while, and a new execution comes in again, this new execution will experience a little latency. The succeeding executions should be faster afterwards.

This is to avoid the cloud compute from being "idling" for too long so that we can fully utilize the available resources to serve other customers.

Also as a cloud solution, there are definitely caching in different parts of the service. This also means normally the first execution (in a while) would have to pay that performance cost for succeeding executions.

So if it's possible, I think it'd be best for you to skip the first execution in your performance tests.

Was this answer helpful?


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.