EG: smarter task grouping and in-thread merging