Also it's possible that your vectorized versions are being passed to
multithreaded routines? The setup might require more memory but the
execution would run in parallel.

On Thu, May 12, 2016 at 9:46 AM, Steven G. Johnson <[email protected]>
wrote:

>
>
> On Thursday, May 12, 2016 at 8:51:44 AM UTC-4, Miguel Bazdresch wrote:
>>
>> honestly I've been testing out different devectorizations of my
>>> algorithms and I keep getting slower results, not faster, so either I
>>> really suck at writing for loops or Julia is doing a good job with my
>>> vectorized code.
>>>
>>
> Make sure your loops are in a function — don't benchmark in global scope
> (see the performance tips sections of the manual).  Try running your
> function through @code_warntype myfunction(args...) and see if it warns
> marks any variables as type "ANY" (which indicates a type instability in
> your code, see the performance tips),
>
> Also, if you do "@time myfunc(args...)" and it indicates that you did a
> huge number of allocations, you could either have a type instability or be
> allocating new arrays in your inner loops (it is always better to allocate
> arrays once outside your inner loops and then update them in-place as
> needed).
>

Reply via email to