To reproduce: Create an Prefab some scripts drawn with Odin. Add an Animation component, create an AnimationClip for this component. Open the Prefab in Prefab Edit Mode and preview the animation using the Animation Window:
In this case I have two simple scripts that are drawn by Odin, nothing fancy inside of them. When previewing the animation editor performance is terrible, but if I minimize these components views in the Inspector Window - performance recovers.
Deep Profile results point to a lot of work done by Odin due to PrefabUtility.GetPropertyModifications():
See chain below: