Hello everybody !

I have come across what seems to be a problem with Poset
and UniqueRepresentation. After an optimization branch I just wrote
(#17408), this is what costs the most time when you build a Poset. Look at
this:

sage: g = posets.BooleanLattice(5).hasse_diagram().transitive_closure();
sage: g = g.cartesian_product(g)
sage: %time Poset(g)
CPU times: user 284 ms, sys: 32 ms, total: 316 ms
Wall time: 278 ms
Finite poset containing 1024 elements
sage: %time Poset(g)
CPU times: user 1.63 s, sys: 44 ms, total: 1.68 s
Wall time: 1.61 s
Finite poset containing 1024 elements

Even without my optimisations you see this effect, and I am pretty sure
that the huge time penalty here is because Poset inherits from
UniqueRepresentation. Profiling shows that most of the time is spent
testing equality of posets, which is part of the UniqueRepresentation
initialization. Can anyone see another posible cause for this or, more
importantly, a way to fix it?

Thanks,

Nathann

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to