I have a list lst
matching the pattern {{_String, _String, _?NumericQ, _?NumericQ}..}
. The outer list has about 150,000 elements (inner lists), so it is certainly not very long. When I run:
lst // GroupBy[(#[[2]] &) -> (Drop[#, {2}] &)] // Map[GroupBy[First -> Rest]]
the code takes about 0.4 seconds
to return the result. But when I run
lst // GroupBy[{(#[[2]] &) -> (Drop[#, {2}] &), First -> Rest}]
the code takes about five minutes
to return the result!
Is the second approach not recommended? There is nothing in the official documentation to discourage its use, but it is about three orders of magnitude worse in terms of performance.