If you are using item(), you won’t need to use detach additionally.
However, you would need to call detach() on other tensors you are storing and which are still connected to the computation graph.
Could you post a code snippet to reproduce this slow down and how long would it take to reach the slow down?