-
Notifications
You must be signed in to change notification settings - Fork 38
Performance
There is some overhead in Excel -> R calls, in part because there are several layers of abstraction, and in part because there's a dynamic element to the call. However performance is still pretty good.
Mapping the simplest possible function NOOP <- function(a, b){ 0 }* we find that over 1,000,000 function calls the average time for one call is 42.2 µs. The Excel native function SUM over 1,000,000 calls takes on average 5.445 µs/call. So R functions are an order of magnitude slower.
However this is fixed overhead, and beyond this the calculation time is entirely dependent on R performance. For complex functions, 42 µs is effectively noise. (If you actually have 1 million function calls in an Excel spreadsheet, you may be doing it wrong. Also that still only takes 42 seconds).
More importantly for performance, BERT is not threaded. Excel 2007 and later can use multiple cores to calculate a spreadsheet (provided there are independent branches in the calculation tree). BERT functions are (for now, at least) single threaded and will therefore only be calculated on one thread.
* The simplest possible function that takes arguments, so we can force Excel to recalculate it.