The JIT might eliminate the need to use gc.collect() to free the memory. It won’t help with the timing. For that, I would suggest to use the profiler to see what exactly is getting slower. It is not clear to me that it is necessarily linked.
Best regards
Thomas