@preritj, per your request in tonight's Hangout, you requested that someone take a look to see if filter.py could be optimized. I took a stab at it, and made some small changes, like converting a for loop to a list comprehension, and removing the .keys() in a conditional, as I believe there is a performance penalty with if key in *.keys() (O(n) vs O(1)).
Please keep in mind that I didn't use a profiler to verify any performance improvement. If you do consider merging this PR, please pull down the branch first and verify there are no adverse changes to the expected output.
Also, my feelings will not be hurt if you decide to either decline or ignore this PR (ok, maybe a little but I'm a big boy and life will go on). ;)
@preritj, per your request in tonight's Hangout, you requested that someone take a look to see if filter.py could be optimized. I took a stab at it, and made some small changes, like converting a for loop to a list comprehension, and removing the
.keys()
in a conditional, as I believe there is a performance penalty withif key in *.keys()
(O(n) vs O(1)).Please keep in mind that I didn't use a profiler to verify any performance improvement. If you do consider merging this PR, please pull down the branch first and verify there are no adverse changes to the expected output.
Also, my feelings will not be hurt if you decide to either decline or ignore this PR (ok, maybe a little but I'm a big boy and life will go on). ;)