The RandomFourierDotFeatures don't require the feature vector above (line 119) and directly compute the dot product required and the additional operations in here instead of requiring an additional call to function phi (which is virtual). I 'm not sure what gets to be optimized with the compiler but I think these suffice to make it a tad slower.