<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                # PHP8新特性:`JIT` * * * ## 一、`PHP`運行速度測試 ### 1、新建`php`文件 ~~~php <?php // 返回當前時間戳的微秒數 $start = microtime(true) ; $total = 0; for ($i=0; $i < 1000000; $i++) { $total += $i; } echo "Count: ".$i.",Total: " . $total . "\n"; // 返回當前時間戳的微秒數 $end = microtime(true); // 計算開始到結束,所用時間 $spend = floor(($end - $start) * 1000); echo "Time use: " . $spend . " ms\n"; ?> ~~~ ### 2、`php8` 未開啟JIT測試 ![](https://img.kancloud.cn/82/a4/82a4dbb62a458c679d69914937ff8533_665x205.png) ### 3、`php8` 開啟JIT測試 ![](https://img.kancloud.cn/30/1c/301ccf3e258451de1bcee58220a3b106_555x138.png) * * * ## 二、`JIT`(即時編譯)編譯器 * `JIT`(Just-In-Time)即時編譯器是`PHP 8.0`中最重要的新功能之一,可以極大地提高性能。 * `JIT`編譯器將作為擴展集成到`php`中`Opcache`擴展 用于運行時將某些操作碼直接轉換為從`cpu`指令。 僅在啟用`opcache`的情況下,`JIT`才有效 ### 1、`Opcache`擴展 * `OPcache`通過將`PHP`腳本預編譯的字節碼存儲到共享內存中來提升`PHP`的性能, 存儲預編譯字節碼的好處就是:省去了每次加載和解析`PHP`腳本的開銷。 ### 2、`Opcache`開啟 * 文件位置:找到自己的php.ini 我的 /usr/local/php/etc/php.ini ~~~php zend_extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20200930/opcache.so ~~~ ### 3、`Opcache`配置 ~~~php ; Determines if Zend OPCache is enabled opcache.enable=1 ; Determines if Zend OPCache is enabled for the CLI version of PHP opcache.enable_cli=0 ; The OPcache shared memory storage size. opcache.memory_consumption=128 ; The amount of memory for interned strings in Mbytes. opcache.interned_strings_buffer=8 ; The maximum number of keys (scripts) in the OPcache hash table. ; Only numbers between 200 and 1000000 are allowed. opcache.max_accelerated_files=10000 ~~~ ### 4、`JIT`配置(新增) ~~~php opcache.jit=tracing opcache.jit_buffer_size=100M ~~~ ### 5、`JIT`速度測試 ![](https://img.kancloud.cn/30/1c/301ccf3e258451de1bcee58220a3b106_555x138.png) ![](https://img.kancloud.cn/af/4f/af4f1346a3411f2bb20def658008b62b_1155x510.png) ### 6、php 擴展目錄 * 該目錄可以不用管 執行到第五步應該就可以用php8的jit了 ~~~php extension_dir = "ext" ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看