I am optimizing the performance of my code, in a snippet I use lengthy 2D lists that involve BlockMap
and Total
function.
For example, for a very large list:
list = Table[i, {i, 1, 10^4}, {j, 1, 10^4}];
My computation is like this:
BlockMap[Total[#, 2] &, list, {3,3}]; // AbsoluteTiming
The timing result running on my PC is 7 sec.Which is not very quick I guess.
I am wondering if there is any other robust and efficient way to improve the speed. As fast as it could. Thank you!