[using MPS 2017.2.3 with Windows 7]
I have a checking rule that makes heavy use of sequences. It performs some checks on a big sequence and filters down the sequence (partly with a recursive function) until the sequence only contains items that don't meet the requirements of the check.
Eventually, I build an error message for the user, where I access the final sequence (thus actually building it, I suppose). WIth some sample models, this check takes 8-10 seconds per run (!) with my current implementation, which is quite a lot.
When I replace the sequence type in my implementation with list OR nlist, the check takes only 150-200 ms. I did not change any logic (still using recursion, still using higher order functions like disjunction and union).
Can somebody reason about that? Is the generated code significantly different when using list vs. sequence? I recently tried to make heavy use of sequences since out memory footprint is already pretty big and I was hoping that we could minimize the memory footprint by using sequences over list, but maybe this is a flawed assumption already.
Any information on when and how to use sequences would be appreciated, but in particular I would be interested to learn if somebody could reason about above mentioned differences in runtime.