use sprintf if format has simple characters, add benchmark