Are there any best practices for optimizing website performance while using open_basedir?

When using open_basedir in PHP to restrict the files that can be accessed by scripts, it can sometimes impact website performance due to the additional checks that need to be made. To optimize website performance while still using open_basedir, it is recommended to specify only the necessary directories that need to be accessible, rather than restricting access to the entire filesystem.

ini_set('open_basedir', '/var/www/html:/tmp');