ENH: memory in mask computation
ENH: cache clean only if filter