Not exactly what you wanted, but I hope this helps:

Bids is a Compose that creates an array of 10000 objects like this with random values

From:
range(0,10000)
Map id:
rand(0,100)
Map bid:
rand(1, 100000)
Select
From (Creates an array of unique ids):
xpath(
xml(json(concat('{"Root":{"Item":', body('Bids'),'}}'))),
'//id[not(preceding::id=.)]/text()'
)
Map id:
item()
Map maxid:
max(
json(
replace(
string(
xpath(
xml(json(concat('{"Root":{"Item":', body('Bids'),'}}'))),
concat('//Item[id="', item(), '"]/bid/text()')
)
),
'"',
''
)
)
)
It takes just a few seconds to get an array of ids with max bids:

Even faster with XML creation in one additional step:
