Commit 9117f64
committed
Base.MPFR: avoid reading the global defaults unless necessary
Another follow-up to #51362.
Make sure the global default precision and rounding mode are only
dereferenced when necessary (when there's no relevant scope, in the
ScopedValues sense).
Currently this change doesn't result in performance improvements,
presumably due to how costly the access to a `ScopedValue` currently
is, but the idea is to avoid the cost of the dereference when
possible.
Once ScopedValues are better optimized by the compiler, I guess this
would also result in better effects in case it's known that a call is
within a ScopedValues scope.1 parent 30177d0 commit 9117f64
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
| 241 | + | |
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| |||
1039 | 1039 | | |
1040 | 1040 | | |
1041 | 1041 | | |
1042 | | - | |
| 1042 | + | |
1043 | 1043 | | |
1044 | 1044 | | |
1045 | 1045 | | |
| |||
0 commit comments