From: Eric F. <ef...@km...> - 2004-06-10 03:48:27
|
John, For the command-line selection mechanism of numerix.py to work, the following change is needed: if which[0] is None: ## Add this line which = rcParams['numerix'], "rc" Otherwise, the rcParams value clobbers the command-line value. Update on pcolor_demo2.py: strange things are going on, but now, using profile.py, I get 2.72 seconds with Numeric and 9.49 seconds with numarray. I don't have any explanation for why it was taking 80 seconds with numarray when I tried it earlier today. It is still much slower than with Numeric, though, which seems odd. Eric |
From: Perry G. <pe...@st...> - 2004-06-10 13:10:35
|
Eric Firing wrote: > Update on pcolor_demo2.py: strange things are going on, but now, using > profile.py, I get 2.72 seconds with Numeric and 9.49 seconds with > numarray. I don't have any explanation for why it was taking 80 seconds > with numarray when I tried it earlier today. It is still much slower > than with Numeric, though, which seems odd. > Numarray will be slower on "smaller" operations, in particular if one is manipulating many small arrays, or looping over many indiviual array element accesses. I haven't profiled it but I'm guessing the difference lies in the list comprehension that calculates the vertices which is doing many array indexings. Perry Greenfield |
From: John H. <jdh...@ac...> - 2004-06-10 14:25:20
|
>>>>> "Eric" == Eric Firing <ef...@km...> writes: Eric> John, For the command-line selection mechanism of numerix.py Eric> to work, the following change is needed: Eric> if which[0] is None: ## Add this line which = Eric> rcParams['numerix'], "rc" Eric> Otherwise, the rcParams value clobbers the command-line Eric> value. Thanks for the alert on the numerix problem. The numerix module was written before matplotlibrc existed and it appears was not properly updated. It may be better to simplify this and only provide 2 choices, command line then rc file. Does anyone need any of the other methods of choosing numerix? Is there any reason to keep .numerix or the NUMERIX env var? Eric> Update on pcolor_demo2.py: strange things are going on, but Eric> now, using profile.py, I get 2.72 seconds with Numeric and Eric> 9.49 seconds with numarray. I don't have any explanation Eric> for why it was taking 80 seconds with numarray when I tried Eric> it earlier today. It is still much slower than with Eric> Numeric, though, which seems odd. pcolor_demo2 uses imshow which is written in extension code using the numerix/numarray compatibility layer. Todd and Perry can correct me if I'm wrong, but I think you'll get better numarray performance if you compile that extension with the 'NUMERIX = numarray' in setup.py. The NUMERIX variable in setup.py determines which library the extension code is compiled against. Whether you use numeric or numarray, it will work with either, but you should get much better performance if you match this compile flag to the library you use most. Let us know if this is indeed the cause of the performance hit. Here are my numbers (best of three runs) rc setting Numeric | numarray compiled | -------------------------------- Numeric | 0.45s | 1.13s numarray | 0.59s | 0.60s JDH |
From: Todd M. <jm...@st...> - 2004-06-10 17:16:38
|
On Thu, 2004-06-10 at 09:57, John Hunter wrote: > >>>>> "Eric" == Eric Firing <ef...@km...> writes: > > Eric> John, For the command-line selection mechanism of numerix.py > Eric> to work, the following change is needed: > > Eric> if which[0] is None: ## Add this line which = > Eric> rcParams['numerix'], "rc" > > Eric> Otherwise, the rcParams value clobbers the command-line > Eric> value. > > Thanks for the alert on the numerix problem. The numerix module was > written before matplotlibrc existed and it appears was not properly > updated. It may be better to simplify this and only provide 2 > choices, command line then rc file. Does anyone need any of the other > methods of choosing numerix? Is there any reason to keep .numerix or I don't think so. It's only useful outside the context of matplotlib. > the NUMERIX env var? I can't think of any reason here. What I'd use the env var for is probably better handled by the command line option anyway. If no one objects, I'll rip this stuff out and update the module docstring as Eric suggested. Todd |
From: Eric F. <ef...@km...> - 2004-06-11 03:40:48
|
John, Compiling with numarray improved the pcolor_demo2 times by about a factor of 3 when selecting numarray via numerix, although it is still a little slower on my machine than Numeric-linkage/Numeric Python. No big deal. I am sticking with numarray. Eric >The NUMERIX variable in setup.py determines which library the >extension code is compiled against. Whether you use numeric or >numarray, it will work with either, but you should get much better >performance if you match this compile flag to the library you use >most. > >Let us know if this is indeed the cause of the performance hit. Here >are my numbers (best of three runs) > > > |