[erlang-patches] JInterface: don't compress external binary format if this increases the size

Nico Kruber <>
Fri Jan 25 16:33:44 CET 2013

Hi all,
recently, I noticed, that if I compress an erlang term from Java to external 
binary format, e.g. "[]" (empty list), it is larger than the result returned 
by term_to_binary/2 with compression activated, e.g. term_to_binary([],

I digged a bit deeper and saw that erts_term_to_binary in external.c covers 
that case and if a compressed external term would be bigger than the 
uncompressed version, it returns the uncompressed one.

Please have a look:


More information about the erlang-patches mailing list