This should fix role fixture migration performance issue: perf(migrate): Only re-evaluate users which are potentially changed by ankush · Pull Request #23820 · frappe/frappe · GitHub
And role profile: perf(migrate): update only affected users via role profile by ankush · Pull Request #23821 · frappe/frappe · GitHub