performance tweak for toJSON data frame