Thanks for that patch, the improvement is not as big as from the previous patch - but there is some.
I analysed it a bit more - and I think there needs to be one more change - actually in general and not only for contourlines.
We need different values for the douglas peucker algorithm depending on resolution!
Right now we can only set one value, and that is multiplied for each resolution?
Based on the current state I would like to have
resolution
24= 0.0 or maybe actually have it active at 24 as well trying a value of 0.3 or so. Where there any problems with autorouting or why is it not possible to use it at resolution 24 as well?
23=1.3
22=2.6
21=3.9
20-11=5.4
Especially if we produce a map without resolution 24, then resolution 23 needs to have much lower DP value than the subsequent resolutions. Using 1.3 for resolution 23 makes the quality IMHO good enough to be used for an contourlines only map for GPS devices and skipping resolution 24 altogether. For Desktop use resolution 24 may still make sense for contourlines - but even then the difference is only in very steep areas.
Attached some screenshots at resolution 24, and at 23 with different DP values and one of patch2.