Commenting answers of this question @JasonB noticed the big overhead of RandomPoint
region = ImplicitRegion[1 > 1/(2 q) > p > 1/2, {p, q}];
First@RepeatedTiming[RandomPoint[region], 1]
0.1010
Compare with
First@RepeatedTiming[RandomPoint[Disk[]], 1]
0.00019
Further test for more points ( Mma 10.3 Win7 64 ):
tl = Table[
{
2^k,
First@RepeatedTiming[RandomPoint[region, 2^k], 1]
}, {k, 24}]
Plot
ListLogLogPlot[
tl
, PlotTheme -> "Detailed"
, FrameLabel -> {"# of Random Points", "RepeatedTiming"}]
Its 0.1 seconds overhead which seems unreasonable and we suspect a bug.
Q: Can we find the source of the overhead and a reasonable workaround?
EDIT
tl2 = Table[
{
2^k,
First@RepeatedTiming[RandomPoint[Disk[], 2^k], 1]
}, {k, 25}]
ListLogLogPlot[
{tl, tl2}
, Joined -> True
, PlotTheme -> "Detailed"
, FrameLabel -> {"Number of Random Points", "RepeatedTiming"}
, PlotLegends -> {"ImplicitRegion", "Disk"}]



Slotof Random Points" :p – Marius Ladegård Meyer Oct 20 '15 at 13:41ImplicitRegionis a symbolic region. There must be a lot of symbolic processing going on at the beginning: Is the region bounded? Based on its shape, what method is likely to be fastest for large numbers of points? Then transform the region into the proper form for the method (e.g. is it a rejection method, or direct sampling?)Diskis a predefined region soRandomPointcan easily specialize for it. It probably has a aRandomPointInDiskinternal generator for it... But that's not going to work for an implicit region. – Szabolcs Oct 20 '15 at 14:13