<?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>Erlang非业余研究 &#187; compress</title>
	<atom:link href="http://blog.yufeng.info/archives/tag/compress/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.yufeng.info</link>
	<description>Erlang系统深度探索和应用</description>
	<lastBuildDate>Tue, 17 Jan 2012 06:05:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>ETS新的压缩特性</title>
		<link>http://blog.yufeng.info/archives/922</link>
		<comments>http://blog.yufeng.info/archives/922#comments</comments>
		<pubDate>Sun, 28 Nov 2010 06:44:02 +0000</pubDate>
		<dc:creator>Yu Feng</dc:creator>
				<category><![CDATA[Erlang探索]]></category>
		<category><![CDATA[compress]]></category>
		<category><![CDATA[ets]]></category>

		<guid isPermaLink="false">http://blog.yufeng.info/?p=922</guid>
		<description><![CDATA[原创文章，转载请注明： 转载自Erlang非业余研究 本文链接地址: ETS新的压缩特性 即将发布的R14B01要支持ets的压缩，更大程度的提高内存的利用率。 在github上可以看到这个分支，有兴趣的同学可以下载下来看看。 压缩的时候只压缩value, key是不压缩的。 value特别简单类型的eterm也是不压缩的，因为zip压缩需要一定长度的内容，而且压缩本身也要加入一点的overload. 以下是sverker (author)的提交log. ETS &#8216;compressed&#8217; option. The compressed format is using a slighty modified variant of the extern format (term_to_binary). To not worsen key lookup&#8217;s too much, the top tuple itself and the key element are not compressed. Table objects with only immediate non-key elements will therefor [...]]]></description>
			<content:encoded><![CDATA[<div style="margin-top: 15px; font-style: italic">
<p><strong>原创文章，转载请注明：</strong> 转载自<a href="http://blog.yufeng.info/">Erlang非业余研究</a></p>
<p><strong>本文链接地址:</strong> <a href="http://blog.yufeng.info/archives/922">ETS新的压缩特性</a></p>
</div>
<p>即将发布的R14B01要支持ets的压缩，更大程度的提高内存的利用率。<br />
在github上可以看到这个<a href="https://github.com/erlang/otp/commit/58733c3ad0b1e60af8f44334998f95199d887ba1">分支</a>，有兴趣的同学可以下载下来看看。</p>
<p>压缩的时候只压缩value, key是不压缩的。 value特别简单类型的eterm也是不压缩的，因为zip压缩需要一定长度的内容，而且压缩本身也要加入一点的overload. </p>
<p>以下是sverker (author)的提交log.</p>
<blockquote><p>
ETS &#8216;compressed&#8217; option.</p>
<p>The compressed format is using a slighty modified variant of the extern format<br />
(term_to_binary). To not worsen key lookup&#8217;s too much, the top tuple itself<br />
and the key element are not compressed. Table objects with only immediate<br />
non-key elements will therefor not gain anything (but actually consume one<br />
extra word for &#8220;alloc_size&#8221;).
</p></blockquote>
<p>我们来试验下吧：<br />
<span id="more-922"></span></p>
<pre class="brush: bash; title: ; notranslate">
# erl +ec
Erlang R14B01 (erts-5.8.2) 1[/source] [64-bit] [smp:48:48] [rq:48] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.8.2  (abort with ^G)
1&gt; ets:all().
[8207,4110,13,file_io_servers,inet_hosts_file_byaddr,
 inet_hosts_file_byname,inet_hosts_byaddr,inet_hosts_byname,
 inet_cache,inet_db,global_pid_ids,global_pid_names,
 global_names_ext,global_names,global_locks,ac_tab]
2&gt; ets:info(8207).
[{compressed,true},
 {memory,92},
 {owner,&lt;0.26.0&gt;},
 {heir,none},
 {name,shell_records},
 {size,0},
 {node,nonode@nohost},
 {named_table,false},
 {type,ordered_set},
 {keypos,1},
 {protection,public}]
3&gt; ets:new(xx, [public, compressed]).
16400
4&gt; ets:info(16400).
[{compressed,true},
 {memory,302},
 {owner,&lt;0.32.0&gt;},
 {heir,none},
 {name,xx},
 {size,0},
 {node,nonode@nohost},
 {named_table,false},
 {type,set},
 {keypos,1},
 {protection,public}]
</pre>
<p>祝大家玩的开心。
<div style="margin-top: 0; margin-bottom: 15px; color: #888888; font-size: 80%; font-style: italic">
<p>Post Footer automatically generated by <a href="http://easwy.com/blog/wordpress/wp-posturl/" style="color: #8888FF; text-decoration: underline;">wp-posturl plugin</a> for wordpress.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.yufeng.info/archives/922/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>JVM 64位pointer compress, Erlang呢？</title>
		<link>http://blog.yufeng.info/archives/40</link>
		<comments>http://blog.yufeng.info/archives/40#comments</comments>
		<pubDate>Sun, 11 Oct 2009 05:57:11 +0000</pubDate>
		<dc:creator>Yu Feng</dc:creator>
				<category><![CDATA[网络编程]]></category>
		<category><![CDATA[64 pointer]]></category>
		<category><![CDATA[compress]]></category>

		<guid isPermaLink="false">http://blog.yufeng.info/?p=40</guid>
		<description><![CDATA[原创文章，转载请注明： 转载自Erlang非业余研究 本文链接地址: JVM 64位pointer compress, Erlang呢？ 前端时间看到JVM的 64 pointer compress技术，蛮多感慨的。具体的可以 google 64位 pointer compress 来了解更多。 好不容易从32位系统中逃脱，解决了4G内存的问题，而且64位的cpu更多的寄存器，可以带来更好的性能。但是怎么又碰到问题了。64位的系统，64位的指针，意味着更多的数据访问， cpu速度是提高了，但是内存的带宽和访问速度没有大的提高。而且内存的访问速度和cpu的cycle差几个数量级别，所以对于普通的网络程序来讲，大部分是处理信息的变形，也就是说是把内存里面的数据从一个形式变成另外一个形式。 cpu性能的提高对这种程序来讲 影响不是很大。倒是因为数据的量加大了1倍， 导致整体的性能降低了百分几十。实际的硬件系统也没有那么多内存，一般都是16G以下，所以才有人去想在64位系统下，用36位的指针，减少内存的访问。 erlang的系统基本上是个网络程序，所以这个问题就非常突出。 目前没看到otp vm的这方面的打算， 我还是乖乖的用我的32位系统 Post Footer automatically generated by wp-posturl plugin for wordpress.]]></description>
			<content:encoded><![CDATA[<div style="margin-top: 15px; font-style: italic">
<p><strong>原创文章，转载请注明：</strong> 转载自<a href="http://blog.yufeng.info/">Erlang非业余研究</a></p>
<p><strong>本文链接地址:</strong> <a href="http://blog.yufeng.info/archives/40">JVM 64位pointer compress, Erlang呢？</a></p>
</div>
<p>前端时间看到JVM的 64 pointer compress技术，蛮多感慨的。具体的可以 google<br />
64位 pointer compress 来了解更多。</p>
<p>好不容易从32位系统中逃脱，解决了4G内存的问题，而且64位的cpu更多的寄存器，可以带来更好的性能。但是怎么又碰到问题了。64位的系统，64位的指针，意味着更多的数据访问， cpu速度是提高了，但是内存的带宽和访问速度没有大的提高。而且内存的访问速度和cpu的cycle差几个数量级别，所以对于普通的网络程序来讲，大部分是处理信息的变形，也就是说是把内存里面的数据从一个形式变成另外一个形式。 cpu性能的提高对这种程序来讲 影响不是很大。倒是因为数据的量加大了1倍， 导致整体的性能降低了百分几十。实际的硬件系统也没有那么多内存，一般都是16G以下，所以才有人去想在64位系统下，用36位的指针，减少内存的访问。</p>
<p>erlang的系统基本上是个网络程序，所以这个问题就非常突出。 目前没看到otp vm的这方面的打算， 我还是乖乖的用我的32位系统
<div style="margin-top: 0; margin-bottom: 15px; color: #888888; font-size: 80%; font-style: italic">
<p>Post Footer automatically generated by <a href="http://easwy.com/blog/wordpress/wp-posturl/" style="color: #8888FF; text-decoration: underline;">wp-posturl plugin</a> for wordpress.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.yufeng.info/archives/40/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

