speed up dataframe conversion