internal enthought.traits package: a progress report

Darren Dale wrote:

Building does not seem to be a problem, just do the usual python setup.py build, etc. I ran backend_driver on my not-so-speedy home computer:

Darren,

Well done! I blew away other versions of traits, updated mpl, built and installed, and traits appeared. No pain.

The not quite as good news is that on my Lenovo T60 laptop, the Template takes 0.57 minutes with traited config versus 0.45 with old config. Not a huge difference, and roughly consistent with your timing, but still a penalty. I also see about 20% in simple_plot using Agg. It's probably tolerable. (The comparison was made by switching only the NEWCONFIG variable in __init__.py.)

Eric

···

with traited config:

Backend Agg took 2.77 minutes to complete
        template ratio 1.748, template residual 1.187
Backend PS took 2.64 minutes to complete
        template ratio 1.666, template residual 1.055
Backend Template took 1.59 minutes to complete
        template ratio 1.000, template residual 0.000
Backend PDF took 3.35 minutes to complete
        template ratio 2.112, template residual 1.764
Backend SVG took 2.90 minutes to complete
        template ratio 1.826, template residual 1.309

and without:

Backend Agg took 2.59 minutes to complete
        template ratio 1.898, template residual 1.226
Backend PS took 2.29 minutes to complete
        template ratio 1.675, template residual 0.921
Backend Template took 1.36 minutes to complete
        template ratio 1.000, template residual 0.000
Backend PDF took 2.92 minutes to complete
        template ratio 2.139, template residual 1.555
Backend SVG took 2.91 minutes to complete
        template ratio 2.129, template residual 1.541

changes in svn-4156.

Darren

Darren Dale wrote:
> Building does not seem to be a problem, just do the usual python setup.py
> build, etc. I ran backend_driver on my not-so-speedy home computer:

Darren,

Well done! I blew away other versions of traits, updated mpl, built and
installed, and traits appeared. No pain.

The not quite as good news is that on my Lenovo T60 laptop, the Template
takes 0.57 minutes with traited config versus 0.45 with old config. Not
a huge difference, and roughly consistent with your timing, but still a
penalty. I also see about 20% in simple_plot using Agg. It's probably
tolerable. (The comparison was made by switching only the NEWCONFIG
variable in __init__.py.)

Yes, these results are not consistent with what Fernando reported after
working with Dave Peterson:

# Using traits

maqroll[mpl-traits-debug]> time ./simple_plot.py
*** Using Traits!!!
1.844u 0.212s 0:02.13 96.2% 0+0k 0+0io 0pf+0w
maqroll[mpl-traits-debug]> time ./simple_plot.py
*** Using Traits!!!
1.840u 0.216s 0:02.58 79.4% 0+0k 0+0io 0pf+0w
maqroll[mpl-traits-debug]> time ./simple_plot.py
*** Using Traits!!!
1.836u 0.196s 0:02.12 95.2% 0+0k 0+0io 0pf+0w

# NOT Using traits

maqroll[mpl-traits-debug]> time ./simple_plot.py
2.200u 0.280s 0:02.67 92.8% 0+0k 0+0io 0pf+0w
maqroll[mpl-traits-debug]> time ./simple_plot.py
2.248u 0.220s 0:02.74 89.7% 0+0k 0+0io 0pf+0w
maqroll[mpl-traits-debug]> time ./simple_plot.py
2.216u 0.244s 0:02.72 90.0% 0+0k 0+0io 0pf+0w

Fernando, do you have a record of the changes you guys made at SciPy-2007?

···

On Thursday 08 November 2007 03:16:14 am Eric Firing wrote:

> with traited config:
>
> Backend Agg took 2.77 minutes to complete
> template ratio 1.748, template residual 1.187
> Backend PS took 2.64 minutes to complete
> template ratio 1.666, template residual 1.055
> Backend Template took 1.59 minutes to complete
> template ratio 1.000, template residual 0.000
> Backend PDF took 3.35 minutes to complete
> template ratio 2.112, template residual 1.764
> Backend SVG took 2.90 minutes to complete
> template ratio 1.826, template residual 1.309
>
>
> and without:
>
> Backend Agg took 2.59 minutes to complete
> template ratio 1.898, template residual 1.226
> Backend PS took 2.29 minutes to complete
> template ratio 1.675, template residual 0.921
> Backend Template took 1.36 minutes to complete
> template ratio 1.000, template residual 0.000
> Backend PDF took 2.92 minutes to complete
> template ratio 2.139, template residual 1.555
> Backend SVG took 2.91 minutes to complete
> template ratio 2.129, template residual 1.541

No, we just went through the codebase by hand and quickly removed
anything that looked like it would do namespace packages. Once that
was out of the way, the traits init was actually *shorter* than the
non-traits one, since traits property-like checks are dispatched in a
tight, highly optimized C core (ctraits.c) instead of via pure python.

Sorry not to have that benchmark code available, at this point I think
I'd have to redo it by hand.

Cheers,

f

···

On Nov 8, 2007 7:10 AM, Darren Dale <darren.dale@...143...> wrote:

Fernando, do you have a record of the changes you guys made at SciPy-2007?

Eric Firing wrote:

Darren Dale wrote:
  

3) We can not include traits-3 without either adding setuptools as an external dependency (which is already true for python-2.3 users) or monkey-patching distutils. traits-3 includes some pyrex code, which standard distutils does not recognize.
    
Is it a viable alternative to add pyrex as an external dependency? Pyrex.Distutils makes it easy to use pyrex modules via otherwise standard setup.py scripts. And pyrex itself is pure python, very easy to install.
  

We can also just package the .c file built by Pyrex whenever the developer changes the .pyx file. That way, there is no further infrastructure to include. On the other hand, as Darren suggested later, one can do what setuptools' build_ext command does without setuptools (if an extension source ends in .pyx, call pyrexc on it. If pyrexc is not available, skip that step. In both cases, then compile the .c file with the c compiler.) Darren, if you're still having trouble with this, I can dig up the old code I had that did this (I switched to setuptools for this, and other stuff, a long time ago).

Thanks for the offer. For now, I think it is best that we use traits-2.6,
which doesnt have any pyrex code. Once traits-3 stabilizes and is released,
I'll try what you have suggested.

Darren

···

On Sunday 11 November 2007 7:08:38 pm Andrew Straw wrote:

Eric Firing wrote:
> Darren Dale wrote:
>> 3) We can not include traits-3 without either adding setuptools as an
>> external dependency (which is already true for python-2.3 users) or
>> monkey-patching distutils. traits-3 includes some pyrex code, which
>> standard distutils does not recognize.
>
> Is it a viable alternative to add pyrex as an external dependency?
> Pyrex.Distutils makes it easy to use pyrex modules via otherwise
> standard setup.py scripts. And pyrex itself is pure python, very easy
> to install.

We can also just package the .c file built by Pyrex whenever the
developer changes the .pyx file. That way, there is no further
infrastructure to include. On the other hand, as Darren suggested later,
one can do what setuptools' build_ext command does without setuptools
(if an extension source ends in .pyx, call pyrexc on it. If pyrexc is
not available, skip that step. In both cases, then compile the .c file
with the c compiler.) Darren, if you're still having trouble with this,
I can dig up the old code I had that did this (I switched to setuptools
for this, and other stuff, a long time ago).