There are lots of minor performance/style tips we can give, but they are 
unlikely to make any noticable difference in total execution time. I did 
look at the Profile, and it seems to spend much time on lines containing 
vectorized expressions. I am not able to follow the code flow, and that 
makes it hard to make changes and be certain that my version does the same 
as yours.

One line stood out as a particularly bad (for performance) example was

Li += path_throughput .* e .* colour

This allocates 3 temporary arrays for no particular use, and allocation of 
small arrays are currently a slow process.
A faster version would (probably) be

@assert size(Li) == size(path_throughput)
@assert size(Li) == size(e)
@assert size(Li) == size(colour)
@inbounds for i = 1:length(Li)
    Li[i] = path_throughput[i] * e[i] * colour[i]
end

PS: the assertions can probably be removed, but I don't want to give away 
code that uses @inbounds without being certain that the access is within 
bounds.

kl. 12:09:30 UTC+2 tirsdag 20. mai 2014 skrev Alex følgende:
>
> Hi,
>  
>
>> I'm still confused as to the two types of NULL. 
>>
>> Well, *I think* the main point is that nothing is an instance of the 
> type Nothing, while None is itself a type ("the bottom of the type graph"). 
> In the context of intersect it seems to make sense to return an object or 
> nothing.
>  
>
>> I changed None to nothing. It's not really called enough to be a 
>> difference, but if it's more "julia-ish" I'll go with it.
>>
>> After posting I also realized that this will most likely not matter :-/
>
> BTW, have you actually tried julia 0.3-prerelease? This might also make a 
> difference ...
>
> Best,
>
> Alex.
>

Reply via email to