You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Subclasses of Singleton are over 3x faster when recreating the ring:
sage: from sage.misc.fast_methods import Singleton
sage: from sage.rings.infinity import _uniq
sage: class Foo(_uniq, object):
....: def __init__(self):
....: pass
sage: class Bar(Singleton, object):
....: def __init__(self):
....: pass
sage: %timeit Foo()
The slowest run took 71.72 times longer than the fastest. This could mean that an intermediate result is being cached.
1000000 loops, best of 3: 306 ns per loop
sage: %timeit Bar()
The slowest run took 400.59 times longer than the fastest. This could mean that an intermediate result is being cached.
10000000 loops, best of 3: 94.6 ns per loop
Also IMO, it is a more Sage standard class than the _uniq, and so, more maintainable.
Subclasses of
Singleton
are over 3x faster when recreating the ring:Also IMO, it is a more Sage standard class than the
_uniq
, and so, more maintainable.CC: @rwst @paulmasson @eviatarbach
Component: symbolics
Author: Travis Scrimshaw
Branch/Commit:
099d7ce
Reviewer: Ralf Stephan
Issue created by migration from https://trac.sagemath.org/ticket/20831
The text was updated successfully, but these errors were encountered: