Short answer, use the DEM.
Handheld GPS units of the type you mention (consumer grade), can potentially use two different methods to figure elevation - the calculated GPS position or an internal barometric altimeter. Because of the way GPS works (explained at the page mkennedy originally linked to in a comment, and elsewhere), without high-grade, corrected systems, the barometric method is typically more accurate than GPS. The next step up from Consumer is Differential, which according to that page has a vertical accuracy of 2-3x horizontal, and above that is Survey Grade which can get down to mm level depending on mode and range factors. Differential and Survey do use GPS calculation rather than barometric.
However the barometric method still has issues - readings can be affected by weather as the air pressure and temperature changes. You're unlikely to get consistently detailed or accurate elevation readings. I use a Garmin 60CSx and could provide multiple GPS track examples of this; I have tracks that are loops yet show a 200ft vertical difference between the start and end points even though they're the same place, as well as multiple versions of the same track with completely different elevations throughout. Some documentation on their Edge units puts vertical accuracy with calibrated barometric readings at +/-50 feet.
A couple of related links from Garmin's FAQ:
And there are many other places on the web you can find information/discussions about GPS calculated vs barometric altimeter accuracy for elevation readings, particularly related to handheld consumer units. Bottom line, every unit will return different values, and even the same unit will on different trips.
On the other hand, the DEM is basically a mapped value you're comparing the route against. You will have inaccuracies based on both the horizontal and vertical resolution of the DEM (so higher res is better), but it will be consistent from track to track (assuming said tracks are within a given horizontal tolerance of course). A DEM or map with contours or any other such data source is basically fixed - the values are what they were when measured/interpolated. But each GPS track is going to be whatever the unit recorded at whatever time, so it will differ from the map value at the same point. This is readily apparent on GPS units which are capable of displaying map data; you can see the elevation the map says you are at along with what the altimeter and potentially even GPS calculated elevation values are (and all three will probably differ).