In this graph, you can see that around z=4, the code slow down a lot.
This does not seem to be due to the diminution of the time step:
When looking at the task graph, we can see that the code is not able to use more than 1 thread.
The large tasks are for the stars.