here is a guide on React flow performance, which could help you: https://www.synergycodes.com/blog/guide-to-optimize-react-flow-project-performance