Question

I'm autofilling some columns in Excel (one at a time). These column use a UDF I wrote in ExcelDna. Using taskmanager, I notice that only half of the cores are being used. Excel settings is set to "use all processors on this computer." So I can't figure out why only half the cores are in use. Thoughts?

Was it helpful?

Solution

This page contains some insightful explainations about multi-processing in Excel 2007+ http://msdn.microsoft.com/en-us/library/office/aa730921(v=office.12).aspx#office2007excelperf_ExcelPerformanceImprovements

*Ref: "Multithreaded Calculations" "Some Excel features do not use multithreaded calculation, for example: Data table calculation (but structured references to tables do use MTC). User-defined functions (but XLL functions can be multithread-enabled). XLM functions. INDIRECT, CELL functions that use either the format2 or address options. GETPIVOTDATA and other functions referring to PivotTables or cubes. Range.Calculate and Range.CalculateRowMajorOrder. Cells in circular reference loops. "

Since it doesn't specifically describe "autofill" - I'll take a crack at it from a concurrency perspective. Please forgive if some of this is speculation..

Certain functions require an "in-order" task that cannot easily be split across processors, we might suspect that fill is one of them. (It requires sequential operation in some of it's modes.. example: stepping 1,1.2,1.4,etc). In this example, processor 2 can't just start from the middle of the page without performing a new/custom independant calculation. Special functions would have to be designed. Perhaps they decided not to code for these kinds of scenerios. With formulas I can't see this even being possible, because you could be creating a formula tree.

Other operations are indepentant based on the formula trees (see link). This strongly implies Excel won't multi-process a complext formula tree either .. so if you have numerous formulas connected, they (that tree) will be only be processsed, in order, by one processor.

Granted, there's all kinds of complex work-arounds for these situations.. (perhaps similiar to compilers, SQL servers, etc) but the documentation above is highly suggestive that Microsoft designed it to streamline independant tasks only.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top