Which I'm sure depends on some mistake I'm making, but what?
This:
```julia
function imread!(a,fname,sz)
stream, _ = open(`dcraw -w -H 0 -o 0 -h -4 -c $fname`) 
data = read(stream, UInt16, 3, sz[1], sz[2])
for i in eachindex(a)
a[i] = (data[2,i] + 1.)/65536
end
end
```
is a lot faster than this:
```julia
function imread2!(a,fname)
stream, _ = open(`dcraw -w -H 0 -o 0 -h -4 -c $fname`) 
for i in eachindex(a)
data = read(stream, UInt16)
[read(stream,UInt16) for j = 1:2]
a[i] = (data + 1.)/65536
end
close(stream)
end
```
I'm basically trying to avoid allocating the `data` variable, but seems 
like that something else is making this go slower. 
Any ideas?

Reply via email to