[erlang-questions] optimizing mnesia record size

Paul Mineiro <>
Fri Apr 11 23:22:05 CEST 2008


hi.

i'm trying to decrease the memory footprint of an mnesia database.  i
turned some strings into binaries and got some space savings.  past this,
i'm sure how to proceed.

one thing that would help is, is there a way to compute what the record
size will be (maybe within a constant factor?).  i've been playing around
at the shell calling size/1 on erlang:term_to_binary/1 but i'm not even
sure this is indicative.

also, are there some guidelines?  i was a bit surprised to discover that
replacing an atom with binary_to_list/1 composed with list_to_atom/1
actually made things bigger (by previous paragraph's metric). i was also
surprised to discover that really short strings are actually better as
lists rather than binaries.

any pointers would be greatly appreciated.

thanks,

-- p

In an artificial world, only extremists live naturally.

        -- Paul Graham



More information about the erlang-questions mailing list