We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

View Complete Thread
  • Re: PHP 7.2 on IIS extremely slooow . string concat, but everything else works great??!

    Mar 12, 2019 12:36 PM|niceblue|LINK

    And more work ...

    I tried adding php://memory buffer method instead of ob_start() buffer ... (less of a hack). And I found it was almost 2x faster even than ob_start! So the difference in performance between this and standard . concatenation is x600 slower than this method with $n = 300000!! I thought the sql query would be the bottleneck, this is the bottlneck by a really big margin ... ?

    php://memory buffer code

    $timer = microtime(true);
    $handle = fopen("php://memory", "r+");
    for ($i = 0; $i < $n; $i++)
    {
    fwrite($handle, "(" . 123 . "),");
    }
    fseek($handle, 0);
    $output = fread($handle, 1000000);
    fclose($handle);
    $fwritetime = microtime(true) - $timer;
    echo "php://memory concatenation ", $fwritetime, "s<br>";
    echo ($fwritetime / $buffertime), "x difference<br>";