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

Nico Kruber nico.kruber@REDACTED
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([],
[compressed,6}]).

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:
https://github.com/NicoK/otp/compare/maint...maint_jinterface.dont_compress_if_size_increased
https://github.com/NicoK/otp/compare/maint...maint_jinterface.dont_compress_if_size_increased.patch


Nico



More information about the erlang-patches mailing list