Radiation hardness of diamond and silicon sensors compared