Code review comment for lp:~savoirfairelinux-openerp/lp-community-utils/nag_refactor

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

On 03/10/2014 02:12 PM, Sandy Carter (http://www.savoirfairelinux.com)
wrote:
>> > On 03/07/2014 07:45 PM, Sandy Carter (http://www.savoirfairelinux.com)
>>> wrote:
>>> @gbaconnier-c2c
>>> Good point about adding functions to Nag, the reason for turning it
>>> into a class is design and optimization.
>> The rationale about design is very subjective and the one about
>> optimization is dubious:
>>
>> http://hastebin.com/neyedexiju.py
>
> Declaring a class puts members together in memory and reduces the rate of cache misses, you can see this when performing lookups, but mostly when doing operations.
> Try this: http://hastebin.com/difomedika.py
> That's close to 15% increase in speed for summing members.
>

Enlightening, thanks for the explanation.

« Back to merge proposal