Well, compared to what... to not having it? I haven't looked at the code so I don't know how expensive it is, but for sure it's more expensive than not having it.
I have an older iPhone still on iOS 18, so I could theoretically run this same kind of test on that device, upgrade it to iOS 26, and run it again if anyone is interested.