homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author loewis
Recipients loewis, mark.dickinson, pitrou, skrah
Date 2012年04月09日.16:30:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <20120409183023.Horde.sab-ANjz9kRPgw6f8dfCS7A@webmail.df.eu>
In-reply-to <1333988067.75.0.775317539337.issue14520@psf.upfronthosting.co.za>
Content
> In the C version of decimal, do distinct Decimal objects ever share 
> coefficients? (This would be an obvious optimization for methods 
> like Decimal.copy_negate; I don't know whether the C version 
> applies such optimizations.) If there's potential for shared 
> coefficients, that might make the "not count any memory twice" part 
> tricky.
I know of three strategies to deal with such a case:
a) expose the inner objects, preferably through tp_traverse, and
 don't account for them in the container,
b) find a "canonical" owner of the contained objects, and only
 account for them along with the canonical container.
c) compute the number N of shared owners, and divide the object
 size by N. Due to rounding, this may be somewhat incorrect.
History
Date User Action Args
2012年04月09日 16:30:25loewissetrecipients: + loewis, mark.dickinson, pitrou, skrah
2012年04月09日 16:30:24loewislinkissue14520 messages
2012年04月09日 16:30:24loewiscreate

AltStyle によって変換されたページ (->オリジナル) /