#14054: Cythoned UniqueRepresentation
-------------------------------------------------+--------------------------
       Reporter:  SimonKing                      |         Owner:  tbd          
   
           Type:  enhancement                    |        Status:  needs_review 
   
       Priority:  major                          |     Milestone:  sage-5.8     
   
      Component:  performance                    |    Resolution:               
   
       Keywords:  cython UniqueRepresentation    |   Work issues:               
   
Report Upstream:  N/A                            |     Reviewers:  Travis 
Scrimshaw
        Authors:  Simon King                     |     Merged in:               
   
   Dependencies:  #14017, #6495, #14182, #14040  |      Stopgaps:               
   
-------------------------------------------------+--------------------------

Old description:

> `UniqueRepresentation` provides a comfortable way to create unique parent
> structures, and automatically provides a hash and certain comparison
> methods.
>
> Problems:
>
> - It relies on a metaclass, namely `ClasscallMetaclass` and thus has to
> be a Python class. That's bad for speed.
> - It combines two features, namely a cache and unique instance behaviour.
> But in many some cases we want a cache so that two distinct instances can
> still be equal.
>
> Here, I suggest to
>
> 1. separate the two features, by creating a new class
> `sage.unique_representation.CachedRepresentation` as one base of
> `UniqueRepresentation`.
> 2. create a new cdef class `sage.misc.fast_methods.WithRichCmpById`, that
> provides hash and rich comparison, as expected for unique instance
> behaviour.
>
> __Apply__
>
> - [attachment:trac14054_fast_methods-5.8.patch]
> - [attachment:trac_14054-fix-rigged-list.patch]

New description:

 `UniqueRepresentation` provides a comfortable way to create unique parent
 structures, and automatically provides a hash and certain comparison
 methods.

 Problems:

 - It relies on a metaclass, namely `ClasscallMetaclass` and thus has to be
 a Python class. That's bad for speed.
 - It combines two features, namely a cache and unique instance behaviour.
 But in many some cases we want a cache so that two distinct instances can
 still be equal.

 Here, I suggest to

 1. separate the two features, by creating a new class
 `sage.unique_representation.CachedRepresentation` as one base of
 `UniqueRepresentation`.
 2. create a new cdef class `sage.misc.fast_methods.WithRichCmpById`, that
 provides hash and rich comparison, as expected for unique instance
 behaviour.

 __Apply__

 - [attachment:trac14054_fast_methods-5.8.patch]
 - [attachment:trac_14054-fix-rigged-list.2.patch]

--

Comment (by SimonKing):

 Now it should work^(T)^.

 Apply trac14054_fast_methods-5.8.patch trac_14054-fix-rigged-list.2.patch

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14054#comment:71>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" 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-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to