Are you on 32 bit or 64 bit? If 64, an Int32 +/- 1 generates an Int64. Why not 
just declare i to be an Int?

--Tim

On Monday, May 12, 2014 09:53:50 PM cnbiz850 wrote:
> Profile shows the two lines in the function being very expensive. Is
> there anything inappropriate?  Any way to improve?
> 
> function NoUpdate(data::Data)
>      data.cum[data.i] = data.cum[data.i-1]
>      data.i += 1
> end
> 
> type Data
>      cum::Array{Float32,1}
>      i::Int32
>      ...
> end

Reply via email to