« Previous | Next » 

Revision d277b075

Parent 228ef0f2
Child c3231353

Added by Iustin Pop over 11 years ago

Optimise recursive Query filters

Currently, the And and Or filters use very nice code, e.g. in case of

any id <$> mapM evaluateFilter flts

However, looking at the memory profiles shows that application of
any/id to monadic values via '<$>' does not work nicely, losing the
'early' success property. This results in too much memory being used
for thunks in monadic sequencing.

Rather than trying to add more strictness (not sure exactly how, TBH),
switching these to explicit recursion solves the problem, since we
take the 'early' exit problem in our hands and we are explicit about

Memory usage in case of big (e.g. 1000 'Or' elements) is reduced
significantly, and thus also the runtime.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michele Tartara <>


  • added
  • modified
  • copied
  • renamed
  • deleted

View differences