If the traffic traverses the MX to a different VLAN, it will impact the performance as the MX will inspect the traffic. But it depends on the needed throughput f you will notice it.
If you found this post helpful, please give it Kudos. If my answer solves your problem, please click Accept as Solution so others can benefit from it.