question

TB-2770 avatar image
0 Votes"
TB-2770 asked emilyhua-msft commented

Excel: Benchmarking LAMBDAs and helpers

Asked this on answers.microsoft.com and was referred here:

LAMBDA functions and the assorted helpers make it possible to approach problems in a variety of ways, however I'm not aware of any documentation about measuring efficiency of these. From experimenting since the beginning of the year, I have developed intuition about what is inefficient because it will make Excel calculation refresh slow considerably, or crash the instance completely. I don't know how to preference one implementation over another as being "efficient enough" in case I might use some high-powered LAMBDA construction repeatedly in the same workbook. A concrete example I've used a few times is something like:

TimeIt := LAMBDA(fn,param,
LET(
start,NOW(),
execute,fn(param),
end,NOW(),
elapsed,end-start,
elapsed)
)

But this is dependent on a lot of variables, and not very precise.

How can LAMBDA efficiency be measured?

office-excel-itprooffice-scripts-excel-dev
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@TB-2770

To measure efficiency of Formulas, you could try to use Timer function in VBA code. Subtract the start time from the end time to get the calculation time
But we only support general issues of Excel client, for the further issues of VBA code, I would suggest you add the tag "office-vba-dev".
Thanks for your understanding.

Besides, here are 2 Microsoft articles on improving the performance of workbooks, you could also have a look. “Excel performance: Improving calculation performance”, "Excel performance: Tips for optimizing performance obstructions".


1 Vote 1 ·
TB-2770 avatar image TB-2770 emilyhua-msft ·

Thanks, but I'm looking for more than just another way to time execution; how about memory consumption, depth of recursion, etc?

0 Votes 0 ·

@TB-2770
To better help you, you could also post this question in Excel Tech Community.


0 Votes 0 ·

0 Answers