ok, that makes a bit more sense as to why it happens. but there ought to be indeed a better solution...
On Sep 7, 10:41 am, "Nicolas M. Thiery" <[email protected]> wrote: > On Sat, Sep 05, 2009 at 11:02:21AM -0700, Paul-Olivier Dehaye wrote: > > I don't know enough python to tell for sure, but this looks suspicious > > to me. The printout below shows that a lot of time is spent on > > JoinCategory._repr_ (1 underscore) in categories.py and > > SymmetricFunctionAlgebra_classical.__repr__ (2 underscores), and I don > > t understand why it should be that way. Is it normal? (it seems to get > > worse with Big going bigger too) > > Thanks for the report. > > Each time a tensor([a,b]) is calculated, it has, for example, to > retrieve the parent of the result from those of a and b. This is > cached, and looking up this cache involves computing a hash value. > > My bet is that this comes from the default implementation of the > hashing function for SageObject, which is to compute a hash of the > string representation of the object. That's not very safe and is *slow*. > > I have been meaning for a while to use 'id' instead has default > implementation for __hash__ for objects with unique representation. > > Thoughts anyone? > > Should we go for it? Or at least cache the hash function? > > That this repr thing appears for categories rather than parents is > further suspicious. There might be another missing cache somewhere in > the tensor product code. I'll keep this in mind next time I play > around with this! > > Cheers, > Nicolas > -- > Nicolas M. Thiéry "Isil" <[email protected]>http://Nicolas.Thiery.name/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-combinat-devel?hl=en -~----------~----~----~----~------~----~------~--~---
