It's touch & go between gps & a trip comp as when you lean the bike your tyres rolling radius changes, gets smaller, this makes the trip comp over read distance as the wheel is turning faster for the same speed.
With GPS you get the opposite, under reading as it's assuming a straight line between 2 points. You'll also get GPS jitter & wandering, both shown below on a slow ride into town, the faster you go the less jitter effects the reading but you'll get wandering, however that's more systematic. The effects cancel each other out to for the most part.
So over distance I'd say that GPS is probably the more accurate, but for instant measurement, eg your peek speed, a wheel based method is more likely to be accurate.