On a test set of ~20 fields, using a precomputed set instead of a spot-computed tuple for 'in' testing yields ~30% speed improvement, and replacing the manual removal of elements by a listcomp filtering yields ~30% more.
Tests were also performed using sets and set.difference, while it yields better performances than manual element removal it is still worse than listcomp, especially when taking in account the re-serialization to a list
bzr revid: xmo@openerp.com-20101109130847-p1xfmk3zhhivebj1