I had a situation where I needed the membership of 3242 exchange distribution groups as quickly as possible. The existing code took over an hour. I combined "in" filter queries, graph batching, and invoke-parallel, and got it down to 3 seconds.
gist.github.com/JustinGrote/...