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

Fredrik <>
Tue Jan 29 10:05:40 CET 2013


On 01/28/2013 08:13 PM, Nico Kruber wrote:
> On Friday 25 Jan 2013 16:33:44 you wrote:
>> 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
> Turns out, it wasn't just as simple as I thought - but after my latest additions in the above-mentioned branches, everything should be fine again.
> And while I was at it, I also added a method where you can specify the compression level.
>
>
> Nico
> _______________________________________________
> erlang-patches mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-patches
Your patch is now cooking in the 'master-pu' branch.

-- 

BR Fredrik Gustafsson
Erlang OTP Team



More information about the erlang-patches mailing list