Questions about improving the ROS real-time method

Hi,
thanks for your advise.
We are making a mobile car platform(based on ubuntu and ros1), requiring the speed of the car can reach 2m/s, and in the car to rely on laser sensors for slam and obstacle avoidance. By testing, the laser sensor sends a stop command to the drive from an obstacle that detects the distance from the 4m to the system response, and the time of the process (T1) is from 40ms to 100ms. However, the possible maximum of T1 is not 100ms, may be greater, this period of time is uncontrollable. We want T1 to have a controllable maximum (such as 50ms), and the smaller the maximum, the better.
Can you give me any suggestion in this case?
thank you!