[engine] using memoized to avoid repeated keying and unpickling
Review Request #3597 - Created March 23, 2016 and discarded
|kwlzn, patricklaw, stuhood|
This is yet another low hanging fruit but effective performance
In my manual testing
list 3rdparty::, improvement for cold cache is
about 50%, for fully warmed-up cache, it's sightly slower because of the
extra memoized check cost.
memoizedis only for now, there are various
implementations for py2 that we could use later, like  and 
or just switch to py3.
|It should not be necessary to check the type in equality, because the digested blob includes the type (or does, ...||Stu Hood|
|This method will key by the entire step, rather than keying by the keyable fields. But memoizing this method probably ...||Stu Hood|
|Rather than using memoized here, you can catch a few more cases by doing this manually with a dict, and ...||Stu Hood|
Separate two tests one for memoized get the other for mismatched key types, to be more clear.
Revision 2 (+35 -6)
It should not be necessary to check the type in equality, because the digested blob includes the type (or does, if it is relevant).
This method will key by the entire step, rather than keying by the keyable fields.
But memoizing this method probably doesn't make any sense... we know that a particular Step runs exactly once per execution.