← Back to team overview

openerp-community-reviewer team mailing list archive

Re: [Merge] lp:~savoirfairelinux-openerp/lp-community-utils/nag_refactor into lp:lp-community-utils

 

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.

-- 
https://code.launchpad.net/~savoirfairelinux-openerp/lp-community-utils/nag_refactor/+merge/205257
Your team OpenERP Community Reviewer/Maintainer is subscribed to branch lp:lp-community-utils.


References