Bug introduced in 10.0 or earlier and fixed in 11.2
Consider the following function
slowNorm[x_?(Length[#] == 3 && VectorQ[#, IntegerQ] &)] :=
(Pause[1]; Norm[x])
An equivalent implementation is
latticePoint3DQ = (Length[#] == 3 && VectorQ[#, IntegerQ] &);
slowNormAlt[x_?latticePoint3DQ] := (Pause[1]; Norm[x])
However, only the first function can be parallelized efficiently (in both cases all subkernels are already running):
In[1]:= ParallelTable[
slowNorm[{i, 0, 0}], {i, 1, 5}] // AbsoluteTiming
Out[1]= {2.01148, {1, 2, 3, 4, 5}}
In[2]:= ParallelTable[
slowNormAlt[{i, 0, 0}], {i, 1, 5}] // AbsoluteTiming
Out[2]= {5.00941, {1, 2, 3, 4, 5}}
Using Condition instead of PatternTest does result in the same behavior.
Is there a way to check arguments using latticePoint3DQ without losing the ability to parallelize?
Edit: I am using Version 11.1.1.0 of MMA and the Platform is Linux x86 (64-bit)