Open ioannisPApapadopoulos opened 1 year ago
@dlfivefifty just in case you missed this issue you asked me to raise :)
Your code doesn't run since T̃
is not defined
ah sorry! fixed. It's particularly slow on the first run of @time pr[1:n,1:length(xc)]';
Note 0.6s is just making a second copy. That is, when you call pr[1:n,1:length(xc)]
it first populates a matrix and then copies this data to a new matrix.
On the other hand, P[xc,1:n]
populates the returned matrix directly.
So I don't think there's anything obvious that can be done about this. That is, we can't both cache and return a matrix without the overhead of a copy.
Unless we decide to get rid of caching and only do populating. That is, RecurrenceArray
would become completely lazy and not cache any computations. But is it worth the time?
For the paper, I've not used the RecurrenceArrays at all.. probably not worth it for now.
Sometimes
RecurrenceArray
is slower thangetindex
when actually assembling the values e.g.