by esprehn · 2y ago · 0 comments
if err == nil || target == nil {
return err == target
}
So the overhead is the function call and 2 comparisons. I wonder if the `isComparable := reflectlite.TypeOf(target).Comparable()` line was moved into a separate function if the compiler would inline Is() reducing the perf impact.Possibly related: https://github.com/golang/go/issues/61502
Looks like they're working on improving the inliner.
https://github.com/golang/go/commit/af43932c20d5b59cdffca454...
I'd be interesting to see the benchmark after that.