我想优化我的部分代码以提高性能。由于我的应用程序使用命令行工具,我认为并行执行代码行而不是顺序执行代码肯定会提高性能
<?php
$value = exec("command goes here"); //this takes time
/* Some instructions here that don't depend on $value */
/* Some instructions here that don't depend on $value */
$result = $value*2 ; //this is just a dumb example
?>
我想同时执行不依赖于值的代码,$value
以便整个脚本执行得更快,而不是等待exec()
完成