<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>未分類 彙整 - 碼蟻創研工坊 - CODEANT STUDIOS</title>
	<atom:link href="http://codeant.cc/archives/category/uncategorized/feed" rel="self" type="application/rss+xml" />
	<link>http://codeant.cc/archives/category/uncategorized</link>
	<description></description>
	<lastBuildDate>Sat, 31 Oct 2020 06:42:41 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>

<image>
	<url>http://codeant.cc/wp-content/uploads/2020/10/cropped-Code-Ant-Logo-2-32x32.png</url>
	<title>未分類 彙整 - 碼蟻創研工坊 - CODEANT STUDIOS</title>
	<link>http://codeant.cc/archives/category/uncategorized</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>簡單試玩 PHP 8.0 RC3 及 JIT 效能測試</title>
		<link>http://codeant.cc/archives/271</link>
		
		<dc:creator><![CDATA[codeant]]></dc:creator>
		<pubDate>Sat, 31 Oct 2020 04:55:08 +0000</pubDate>
				<category><![CDATA[未分類]]></category>
		<guid isPermaLink="false">http://codeant.cc/?p=271</guid>

					<description><![CDATA[<p>Step 1. 下載 PHP 8.0 RC3 Step 2. 安裝相關套件 Step 3. 進行編譯 Step [&#8230;]</p>
<p>這篇文章 <a href="http://codeant.cc/archives/271">簡單試玩 PHP 8.0 RC3 及 JIT 效能測試</a> 最早出現於 <a href="http://codeant.cc">碼蟻創研工坊 - CODEANT STUDIOS</a>。</p>
]]></description>
										<content:encoded><![CDATA[
<p>Step 1. 下載 PHP 8.0 RC3</p>



<pre class="wp-block-code"><code>wget https://downloads.php.net/~carusogabriel/php-8.0.0RC3.tar.bz2
tar xf php-8.0.0RC3.tar.bz2
cd php-8.0.0RC3</code></pre>



<p>Step 2. 安裝相關套件</p>



<span id="more-271"></span>



<pre class="wp-block-code"><code>sudo apt install libxml2-dev libsqlite3-dev libpng-dev libonig-dev libmariadb-dev libcurl4-openssl-dev libjpeg-dev libxslt-dev</code></pre>



<p>Step 3. 進行編譯</p>



<pre class="wp-block-code"><code>./configure --enable-opcache --enable-opcache-jit --enable-fpm --enable-cli --enable-bcmath --enable-cgi --enable-gd --enable-intl --enable-mbstring --enable-soap --enable-xml --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-fpm-user=www-data --with-fpm-group=www-data --with-curl --with-imap-ssl --with-sqlite3 --with-zlib --with-xsl --with-openssl --with-jpeg --enable-exif --with-mysqli
make -j$(nproc)
make test
./sapi/cli/php -v</code></pre>



<pre class="wp-block-code"><code>PHP 8.0.0RC3 (cli) (built: Oct 31 2020 12:35:04) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.0-dev, Copyright (c) Zend Technologies</code></pre>



<p>Step 4. 編輯 php.ini 啟動 Opcache JIT</p>



<pre class="wp-block-code"><code>vim php.ini-development
# 新增下面內容
zend_extension=/REAL_PATH/php-8.0.0RC3/modules/opcache.so
&#91;opcache]
opcache.enable=1
opcache.enable_cli=1
opcache.jit=1255
opcache.jit_buffer_size=64M
opcache.memory_consumption=128
opcache.max_accelerated_files=10000</code></pre>



<p>Step 5. 再次執行</p>



<pre class="wp-block-code"><code>./sapi/cli/php -c ./php.ini-development -v</code></pre>



<pre class="wp-block-code"><code>PHP 8.0.0RC3 (cli) (built: Oct 31 2020 12:35:04) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.0-dev, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.0RC3, Copyright (c), by Zend Technologies</code></pre>



<p>Step 簡單效能比較</p>



<p>已本身手上有一支每日固定排程，自動產生報表的 PHP 程式來坐比較，需要分析的數據目前約148萬筆資料，會進行簡單的數學運算，不需要連接資料庫，在這種條件下：</p>



<pre class="wp-block-code"><code>PHP 7.4.12 需要 4.448 秒
PHP 8.0.RC3(無 JIT) 需要 4.292 秒
PHP 8.0.RC3(有 JIT) 需要 4.083 秒</code></pre>



<p>就這樣的結果來看，PHP 8 是值得期待的，但是不像 PHP 5 到 PHP 7 那樣子實現了大跨度的效能增進。</p>
<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fcodeant.cc%2Farchives%2F271&amp;linkname=%E7%B0%A1%E5%96%AE%E8%A9%A6%E7%8E%A9%20PHP%208.0%20RC3%20%E5%8F%8A%20JIT%20%E6%95%88%E8%83%BD%E6%B8%AC%E8%A9%A6" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_line" href="https://www.addtoany.com/add_to/line?linkurl=http%3A%2F%2Fcodeant.cc%2Farchives%2F271&amp;linkname=%E7%B0%A1%E5%96%AE%E8%A9%A6%E7%8E%A9%20PHP%208.0%20RC3%20%E5%8F%8A%20JIT%20%E6%95%88%E8%83%BD%E6%B8%AC%E8%A9%A6" title="Line" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_wechat" href="https://www.addtoany.com/add_to/wechat?linkurl=http%3A%2F%2Fcodeant.cc%2Farchives%2F271&amp;linkname=%E7%B0%A1%E5%96%AE%E8%A9%A6%E7%8E%A9%20PHP%208.0%20RC3%20%E5%8F%8A%20JIT%20%E6%95%88%E8%83%BD%E6%B8%AC%E8%A9%A6" title="WeChat" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_sina_weibo" href="https://www.addtoany.com/add_to/sina_weibo?linkurl=http%3A%2F%2Fcodeant.cc%2Farchives%2F271&amp;linkname=%E7%B0%A1%E5%96%AE%E8%A9%A6%E7%8E%A9%20PHP%208.0%20RC3%20%E5%8F%8A%20JIT%20%E6%95%88%E8%83%BD%E6%B8%AC%E8%A9%A6" title="Sina Weibo" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_qzone" href="https://www.addtoany.com/add_to/qzone?linkurl=http%3A%2F%2Fcodeant.cc%2Farchives%2F271&amp;linkname=%E7%B0%A1%E5%96%AE%E8%A9%A6%E7%8E%A9%20PHP%208.0%20RC3%20%E5%8F%8A%20JIT%20%E6%95%88%E8%83%BD%E6%B8%AC%E8%A9%A6" title="Qzone" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fcodeant.cc%2Farchives%2F271&amp;linkname=%E7%B0%A1%E5%96%AE%E8%A9%A6%E7%8E%A9%20PHP%208.0%20RC3%20%E5%8F%8A%20JIT%20%E6%95%88%E8%83%BD%E6%B8%AC%E8%A9%A6" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=http%3A%2F%2Fcodeant.cc%2Farchives%2F271&#038;title=%E7%B0%A1%E5%96%AE%E8%A9%A6%E7%8E%A9%20PHP%208.0%20RC3%20%E5%8F%8A%20JIT%20%E6%95%88%E8%83%BD%E6%B8%AC%E8%A9%A6" data-a2a-url="http://codeant.cc/archives/271" data-a2a-title="簡單試玩 PHP 8.0 RC3 及 JIT 效能測試"></a></p><p>這篇文章 <a href="http://codeant.cc/archives/271">簡單試玩 PHP 8.0 RC3 及 JIT 效能測試</a> 最早出現於 <a href="http://codeant.cc">碼蟻創研工坊 - CODEANT STUDIOS</a>。</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
