I already told you, use faster hardware.
Raytracing IS the software which is processed, and the raytracing technique is slower than not using raytracing technique. Only way to modify software to do less work is to do less raytracing, but that is the same as saying that you don’t want to use raytracing.
So, if raytracing is too slow, don’t use raytracing. Or use faster hardware which can process the raytracing technique faster.
Here’s an example of hardware which is specially designed to process raytracing faster:
You can read on Wikipedia the following about RTX graphics cards and raytracing:
Nvidia RTX is a graphics rendering development platform created by Nvidia, primarily aimed at enabling real time ray tracing. (Link to WP article here)