neuecc / ZeroFormatter

Infinitely Fast Deserializer for .NET, .NET Core and Unity.
MIT License
2.39k stars 248 forks source link

Embedded compression(LZ4) #44

Open neuecc opened 7 years ago

neuecc commented 7 years ago

Compression and serialization are inseparable relationships. By including LZ4 support in the API, we try more efficient compression. For that, I need to implement LZ4 myself (lz4.net is not a good choice).

NimaAra commented 7 years ago

Just out of curiosity, why is lz4.net not a good choice? FYI, I am currently taking a dependency on it in Easy.Compression.

neuecc commented 7 years ago

latest LZ4 implementation is improved https://github.com/lz4/lz4 but lz4.net is not ported yet. RavenDB has own LZ4 implemantation https://github.com/ayende/ravendb/tree/v4.0/src/Sparrow/Compression and it is so good.

NimaAra commented 7 years ago

I see, RavenDB's implementation is indeed quite interesting, can you not use that? I wonder what the license is.

neuecc commented 7 years ago

Well, RavenDB is proprietary software, I think it is difficult.

Anapher commented 7 years ago

The license is AGPL, can be found here: https://ravendb.net/terms (you have to select the tab 'Open Source License EULA'). Dammit.

snalesso commented 7 years ago

Stupid question: what if someone ends up writing code quite similar on his own, without even knowing someone published the same code with a license that doesn't allow copying it? Who can say it was copied?

Anapher commented 7 years ago

@snalesso if you can prove that you wrote that code 100% on your own, everything is fine. I don't think that ravendb will instantly sue you if they noticed, but coping or changing the code from them is strictly forbidden.

snalesso commented 7 years ago

Thank you @Alkalinee. Anyway, I'm pretty confused since, potentially, someone can end up writing the exact same code as yours. With much more probability, just the same code structure. How can he prove he didn't copy since the "copied" code is open source? Lawyers paradise I guess.

P.S. Obviously I'm talking about few LOC

jeff-pang commented 5 years ago

@neuecc can you use this https://github.com/MiloszKrajewski/K4os.Compression.LZ4? I am considering taking this dependency to compress ZeroFormatter. Or will MessagePack.CSharp (LZ4) outperform ZeroFormatter + K4os.Compression.LZ4?