The problem is performance -- `reconstruct` is ~100X slower than the macro
in the benchmark below. The macro solution is as fast as having mutating
data actually, too bad it is no completely generic...
a = [IM(0,0,0,0,0,0,0,0,0,0,0,0) for i in 1:1000000];
function frec(arr::Array{IM,1})
for j in 1:100
for i in 1:1000000
@inbounds arr[i] = reconstruct(a[i], [(:aa, 1),(:bb,2)])
end
end
arr[1].aa+arr[1000000].bb
end
function fim(arr::Array{IM,1})
for j in 1:100
for i in 1:1000000
@set arr i aa=1 bb=2
end
end
arr[1].aa+arr[1000000].bb
end