Re: Curious Timing Results
- To: mathgroup at smc.vnet.net
- Subject: [mg38717] Re: Curious Timing Results
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Mon, 6 Jan 2003 03:45:09 -0500 (EST)
- Organization: Universitaet Leipzig
- References: <av36rc$g08$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi,
In[]:=Developer`PackedArrayQ /@ {x, y}
Out[]={True,False}
Some times PackedArrays are slower -- you have found one.
I expect, that the x Array must be unpacked and this cause
the longer time in Inner[Divide,x,x]
Regards
Jens
Chris Grant wrote:
>
> I find the Timing results below a little curious. Is there a simple
> explanation why I shouldn't?
>
> Chris Grant
>
> In[1]:= x = Table[2.,{i,100000}];
>
> In[2]:= y = Table[If[i<1000000,2.,i],{i,100000}];
>
> In[3]:= SameQ[x,y]
>
> Out[3]= True
>
> In[4]:= Timing[Inner[Divide,x,x]]
>
> Out[4]= {0.44 Second,100000.}
>
> In[5]:= Timing[Inner[Divide,y,y]]
>
> Out[5]= {0.321 Second,100000.}
- Follow-Ups:
- Re: Re: Curious Timing Results
- From: Daniel Lichtblau <danl@wolfram.com>
- Re: Re: Curious Timing Results