performance tweak to ObjectIdDict. fixes #2809