It's probably a wash.
If your number of parents is very large (~49k records), using
Set<Id> is marginally (~16%) faster. For me, the
List<SObject> merge query took on average
.208s and the
Set<Id> merge query took on average
.179s. That does affect the number of queries you could run in a transaction, but for a single query doesn't save you much.
If the number of parents is small, it seems like
List<SObject> may actually be faster, clocking in at
3.5ms, as opposed to
4.1ms for a differential of 17%.
I timed the query as demonstrated below, swapping
parentIds as needed to generate the above data. I ran 5 trials with each configuration so the sample size is not huge.
List<Account> parents = [SELECT Id FROM Account LIMIT 49000];
Set<Id> parentIds = Pluck.ids(parents);
Long start = Datetime.now().getTime();
for (Integer i = 1; i < 10; i++)
List<Opportunity> records = [SELECT Id FROM Opportunity WHERE AccountId = :parentIds];
system.debug(Datetime.now().getTime() - start);
My child table was pretty empty, you could probably rerun this analysis with a heavily used child table and get completely different results.