Normally, a seatpost is a close fit in a seat tube and so is supported over a fairly long length. I the shim is short and only supports the seatpost at the clamp, there will be a lot of stress at that point since the bottom end of the seat tube will be loose in the seat post and free to wobble around. Ideally, the shim should be long enough to support the seatpost in the seat tube over a good length, suggest at least 8 cm.