On Thu, 16 Nov 2006 01:16:17 -0800, Martin Albrecht  
<[EMAIL PROTECTED]> wrote:
>
> 6 * wordsize = 24 byte on 32-bit architectures:
>
> sizeof(pointer) : pointer to the parent
> sizeof(pointer) +sizeof(int) : pointer to type object and reference count
> sizeof(pointer) : function call table
> sizeof(int) : value # this is the redundant value with the Givaro  
> C++ table
> sizeof(pointer): __multiplicative_order #may be removed
>
>> With your cache of the full finite field, it takes only 4 bytes
>> (on a 64-bit machine) to store any element.
>
> Are you referring to the underlying Givaro int representation here? Yes,  
> only this would be used in matrices and maybe polynomials.

NO!!  I'm referring to the full 24 byte Python object!  Most users are
going to just create Python objects that wrap Givaro elements.  Without
caching, every single one takes 24 bytes.  With caching, every one takes
only 4 bytes (+initial table), since all one is doing is storing a pointer.
I.e., if I do

     k = Cached Givaro Field
     l = Non-cached Givaro field

     v = [k.0^3 for _ in xrange(10^6)]
     w = [l.0^3 for _ in xrange(10^6)]

then w will use 6 times as much space as v.

william

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to