From 454335cd043561cc9fe874bc325c152a0727328b Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Tue, 2 Nov 2010 18:08:04 +0100 Subject: ETS 'compressed' option. The compressed format is using a slighty modified variant of the extern format (term_to_binary). To not worsen key lookup's too much, the top tuple itself and the key element are not compressed. Table objects with only immediate non-key elements will therefor not gain anything (but actually consume one extra word for "alloc_size"). --- lib/stdlib/doc/src/ets.xml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'lib/stdlib/doc/src/ets.xml') diff --git a/lib/stdlib/doc/src/ets.xml b/lib/stdlib/doc/src/ets.xml index 702e1b928e..746f94d3f4 100644 --- a/lib/stdlib/doc/src/ets.xml +++ b/lib/stdlib/doc/src/ets.xml @@ -485,6 +485,9 @@ Error: fun containing local Erlang function calls Item=protection, Value=public|protected|private

The table access rights.
+ Item=compressed, Value=true|false

+ + Indicates if the table is compressed or not.
@@ -951,9 +954,10 @@ ets:select(Table,MatchSpec), Name = atom() Options = [Option] -  Option = Type | Access | named_table | {keypos,Pos} | {heir,pid(),HeirData} | {heir,none} | {write_concurrency,bool()} | {read_concurrency,bool()} +  Option = Type | Access | named_table | {keypos,Pos} | {heir,pid(),HeirData} | {heir,none} | Tweaks   Type = set | ordered_set | bag | duplicate_bag   Access = public | protected | private +   Tweaks = {write_concurrency,bool()} | {read_concurrency,bool()} | compressed   Pos = int()   HeirData = term() @@ -1047,13 +1051,13 @@ ets:select(Table,MatchSpec),

{write_concurrency,bool()} - Performance tuning. Default is false. An operation that + Performance tuning. Default is false, in which case an operation that mutates (writes to) the table will obtain exclusive access, blocking any concurrent access of the same table until finished. If set to true, the table is optimized towards concurrent write access. Different objects of the same table can be mutated (and read) by concurrent processes. This is achieved to some degree - at the expense of single access and concurrent reader performance. + at the expense of sequential access and concurrent reader performance. The write_concurrency option can be combined with the read_concurrency option. You typically want to combine these when large concurrent @@ -1091,6 +1095,15 @@ ets:select(Table,MatchSpec), option. You typically want to combine these when large concurrent read bursts and large concurrent write bursts are common.

+ + +

compressed + If this option is present, the table data will be stored in a more compact format to + consume less memory. The downside is that it will make table operations slower. + Especially operations that need to inspect entire objects, + such as match and select, will get much slower. The key element + is not compressed in current implementation.

+
-- cgit v1.2.3