I was using the prerelease 3.0 for OSX I'll look up the date I downloaded 
it later, I'm at a different machine now.  I cannot compile my own because 
I have the incorrect Fortran.
When profiling the Graphs.js maximal_cliques function (with a slightly 
improved Set to avoid the copy and delete for intersection) I observed that 
half of the runtiom was spent on lines creating the value arrays for Sets 
(either in the Dict constructor, or in the Dict empty! function).   My 
instinct was to disbelieve the profiler.  I'll download a newer nightly and 
try again.

On Wednesday, May 21, 2014 11:47:14 AM UTC-4, Stefan Karpinski wrote:
>
> What version of Julia are you using? In current Julia, Array(Nothing,n) 
> actually takes up no storage and returns instantly no matter how large n is:
>
> julia> @time a = Array(Nothing, typemax(Int))
> elapsed time: 3.645e-6 seconds (112 bytes allocated)
> 9223372036854775807-element Array{Nothing,1}:
>  nothing
>  nothing
>  nothing
>  ⋮
>  nothing
>  nothing
>  nothing
>
>
>
> On Mon, May 19, 2014 at 10:54 PM, David Einstein 
> <[email protected]<javascript:>
> > wrote:
>
>> When looking at  the speed of the maximal_cliques algorithm it appears 
>> that Sets are extremely slow, more than an order of magnitude slower than 
>> Python.  Some of this can be attributed to the fact that intersect copies 
>> the first set and then removes the elements that don't belong, instead of 
>> just adding the elements that occur in all sets.  If we fix that, things 
>> are still slow, and if I can trust the profiler it appears that an 
>> inordinate amount of time is being spent creating the value array either in 
>> the constructor or in empty!.
>>
>> I'm not sure what Array(Nothing, n) does, but it seems to take 10 times 
>> as long as Array(Int64, n).  Is there a simple way to make this fast, or 
>> would it be worth the trouble to make a special Set type by cloning Dict 
>> and removing all the value code.
>>
>
>

Reply via email to