Tried posting this yesterday, seems like it didn't work, so here we go again :)
I've been working in the whole Power Platform environment for a year now, mainly Power Automate, and in that context I've been missing an 'Except' function to complement the 'Intersection' and 'Union', as the more naive ways of getting the difference between 2 sets / arrays / lists are slow as I can see from the many posts inhere indicates a lot of you already know!
So I made a Custom Connector that can take 2 arrays, e.g. array 'A' and array 'B', and output the elements of 'A' that aren't also present in 'B'. So if A = [1, 2, 3, 4} and B = [2, 4, 6, 8], the output will be [1, 3].
So, first I got the functionality working for an array of numbers and strings respectively, and after that I got it working for JSON objects, so it's possible to input arrays 'A' and 'B' like before, but now you also need to specify the fields it's comparing, e.g. 'ownerid' from 'A' and 'systemuserid' from 'B'.
I'm fresh out of "programmning school" last summer, and working as the first developer in a company, so I don't have any senior devs or similar to lean on, so there's probably some finishing touches left to make it really "premium", but none the less, I wanna share it with you as I find it really helpful myself.
As for speed of the comparison - I threw a list of approx. 13k json objects and another with approx. 8k json objects at it, and had it compare guids, and it took less than a second for it to finish!
Here's the swagger.json and script.cs in an open GitHub repos ->
Custom Connector
I tried making the README as detailed as possible.
Basically, go to your Power Automate > Custom connectors > New custom connector > Import from an OpenAPI file > add the swagger file > wait for it to finish > go to '4. Code' and enable code, select all 3 actions and add the C# script > Create connector.... and you're ready to go :)
Hope it helps!