For some reason I need to run a C++ program in Windows + PHP. PHP code like:
$start = microtime();
exec("test.exe");
$end = microtime();
When I ran this php file as php test.php
in command line, "test.exe" told its cost time is 11s. But I ran it with apache in browser like localhost/test.php
, it finally output it costed 252s.
Is it any limit in apache when it fork a new process, or something else?
btw, "test.exe" is a program that I wrote to analyze data with windbg.
I use a few data to test its performance.
i. directly use "test.exe"
CDumpAnalyze::Analyze time cost[2.328000]
ii. call with php command line.
$start = microtime();
system("cd F:\\DumpPlatform\\bin\\server && test.exe --cfg=dump_config.ini --gameversion=10000");
//exec("dir");
$end = microtime();
echo $start."
";
echo $end."
";
CDumpAnalyze::Analyze time cost[2.982000]
0.09448800 1378104101
0.11078900 1378104104
iii. run with apache
CDumpAnalyze::Analyze time cost[63.158000]
0.53862700 1378104642
0.75394800 1378104705