Re: [sage-devel] Re: @cached_method -- dog slow -- warning.

2010-03-27 Thread William Stein
On Fri, Mar 26, 2010 at 5:23 AM, Jason Grout wrote: > On 03/26/2010 06:10 AM, Nicolas M. Thiery wrote: >> >> (my favorite cached function), one still gets beside the doc of >> super_categories, a lot of irrelevant documentation about >> cached_functions, which is confusing. Ideally, >> functools.u

[sage-devel] Re: @cached_method -- dog slow -- warning.

2010-03-26 Thread Jason Grout
On 03/26/2010 06:10 AM, Nicolas M. Thiery wrote: (my favorite cached function), one still gets beside the doc of super_categories, a lot of irrelevant documentation about cached_functions, which is confusing. Ideally, functools.update_wrapper would handle this; there was a discussion on trac abou

Re: [sage-devel] Re: @cached_method -- dog slow -- warning.

2010-03-26 Thread Nicolas M. Thiery
On Fri, Mar 26, 2010 at 09:01:35AM +0100, Florent hivert wrote: > >> MORAL: If you care about speed, don't use the cached_method decorator > >> yet. It entails massive overheard. > > I'm very sorry to says that Nicolas and I are well aware of this problem since > a long time. We have been cursing

Re: [sage-devel] Re: @cached_method -- dog slow -- warning.

2010-03-26 Thread Florent Hivert
Hi Willian, hi Jason > On 03/25/2010 08:49 PM, William Stein wrote: >> I was trying to understand why certain modular symbols code was too >> slow, and ran across a method that looked like this (in >> modular/modsym/element.py): >> [...] >> >> Of course, on multiple calls, the above is slow

[sage-devel] Re: @cached_method -- dog slow -- warning.

2010-03-25 Thread Jason Grout
On 03/25/2010 08:49 PM, William Stein wrote: Hi, I was trying to understand why certain modular symbols code was too slow, and ran across a method that looked like this (in modular/modsym/element.py): def modular_symbol_rep(self): try: return self.__modular_symbols

[sage-devel] Re: @cached_method -- dog slow -- warning.

2010-03-25 Thread Jason Grout
On 03/25/2010 09:40 PM, Tom Boothby wrote: My guess is that it would be very easy to speed up the @cached_method and @cached_function decorators. I agree. IIRC, the majority of the problem is in sage/misc/function_mangling.py, and my fault. There is a lot of code in there that gets executed

Re: [sage-devel] Re: @cached_method -- dog slow -- warning.

2010-03-25 Thread Tom Boothby
> My guess is that it would be very easy to speed up the @cached_method and > @cached_function decorators. I agree. IIRC, the majority of the problem is in sage/misc/function_mangling.py, and my fault. -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from th

[sage-devel] Re: @cached_method -- dog slow -- warning.

2010-03-25 Thread Jason Grout
On 03/25/2010 08:49 PM, William Stein wrote: Hi, I was trying to understand why certain modular symbols code was too slow, and ran across a method that looked like this (in modular/modsym/element.py): def modular_symbol_rep(self): try: return self.__modular_symbols