Conversation
|
|
||
| #[pymethods] | ||
| impl TraverseTriesToTakePyRef { | ||
| #[expect(deprecated)] |
There was a problem hiding this comment.
I just expected these for now. PyClassGuard(Mut) does give the same error, PyClassGuard could be allowed I guess, since it is not mutable and does not give access to a Python token. Not sure if that's worth the effort though
629eb51 to
a76cce0
Compare
Merging this PR will degrade performance by 8.32%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | into_u128_zero |
816 ns | 981.3 ns | -16.84% |
| ❌ | into_u128_small |
876.1 ns | 1,041.4 ns | -15.87% |
| ⚡ | test_empty_class_init |
31.6 µs | 28.7 µs | +10.14% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing Icxolu:deprecate/pyref (6922a94) with main (ee629fb)
Footnotes
-
6 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
|
Sorry to be so slow to review this; it's on my mind, I've just been wading a bit through a ~LIFO PR stack. Interestingly I noted when working on #6407 today that I somewhat wonder whether this suggests that we should calculate the contents ptr of I'm not sure if it's too late and counts as breaking? Hopefully not, given |
|
No worries 🙂 I think we could cache it. We would loose the I just wonder whether we should and if this would be the best place, Are you concerned because this is |
11e7925 to
8b3668c
Compare
8b3668c to
6922a94
Compare
Yes, precisely because it's on let guard = obj.try_borrow_guard();
let x = guard.x;
let y = guard.y;
let z = guard.z;... which seems like three cheap field accesses but really is re-resolving the Rust data each time. I concede that One alternative to unblock this could be to remove the I think I'd like to figure out what we do about this (or decide it's a non-issue) before deprecating |
First step of deprecating
PyRefandPyRefMut. This PR deprecates the types itself (targeting 0.30.0 as per #6083 (comment), so leaving as draft for now)We will need a migration guide entry, but I would like to defer that to the second part when I deprecate the
borrowmethods.See also #6083