Hi!

On Oct 24, 7:30 pm, Nils Bruin <nbr...@sfu.ca> wrote:
> Your present proposal doesn't give any upsides for the slowdown. Could
> you give some convincing use-cases, where you give examples of things
> that people are likely to want to do which become easy with your
> extension but are very difficult or impossible in the current model?

Probably the combinat people would be able to come up with striking
examples. My motivation is to generally improve the category framework
in Sage so that one can really work with it mathematically.

Other parts of this aim is:
* Raise the doc test coverage of categories -- see #8800, to be
reviewed
* Let functors act not only on objects of a category, but also on its
morphisms -- see ticket #8807

However, categories in Sage not only have a mathematical aspect: In
Sage, they also provide code. Namely, a category can provide methods
for its objects and for elements of its objects. In that way, it is
not needed to implement certain general algorithms over and over
again, for different types of algebras, for instance. Instead, one
implements it for the category of algebras, and any object X will
inherit these methods, provided that X.category() is a sub-category of
algebras (unless they are overloaded, of course).

I think this is a useful feature, although I also think that it is
often better for the performance to avoid general algorithms and
implement something that is designed for a specific data structure.

> The 1.5% you are giving is a nice guide, but it doesn't really show
> that there is a slow-down, nor how badly this is going to affect
> existing code.

I can not put my finger on it. But the slow-down seems to be more or
less universal. Many doc tests need 1.5 seconds on my machine - but
with my category extension, some of them need 1.6 seconds. And these
little differences sum up.

My category extension tends to increase the number of classes to be
considered in the method resolution order. So, my guess is that it
increases the time for accessing attributes, thereby explaining the
performance loss.

Cheers,
Simon

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to