<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><a href="https://github.com/indygreg/python-zstandard">https://github.com/indygreg/python-zstandard</a> contains a proper, general use C extension. I've implemented most of the C API, including support for training and using dictionaries.<br><br>It is very alpha. I'm sure there are memory leaks from me not using the Python C API properly (this is the first Python C extension I've written). I'm sure it will crash. It also only runs on Python 3.5 at the moment. I'll backport to 2.6 so we can experiment with this in Mercurial.<br><br></div><div class="gmail_quote">If you want a Mercurial clone of the repo, grab it from <a href="https://hg.mozilla.org/users/gszorc_mozilla.com/python-zstandard">https://hg.mozilla.org/users/gszorc_mozilla.com/python-zstandard</a>.<br></div><div class="gmail_quote"><br>On Thu, Sep 1, 2016 at 1:49 PM, Bryan O'Sullivan <span dir="ltr"><<a href="mailto:bos@serpentine.com" target="_blank">bos@serpentine.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">It would be valuable to target a general-purpose package, if only because the existing Python zstd bindings (somewhere on github) are not good.<div><br></div><div>You're right that zstd is a big win over zlib in every way.</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="gmail-h5">On Thu, Sep 1, 2016 at 12:01 AM, Gregory Szorc <span dir="ltr"><<a href="mailto:gregory.szorc@gmail.com" target="_blank">gregory.szorc@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="gmail-h5"><div dir="ltr"><div><div></div>I got caught up in the zstd 1.0 release excitement and started writing a proper Python C extension for it (one that uses the streaming API and doesn't use custom framing like the existing python-zstd package does). The result of what I was able to hack together in a few hours is available at <a href="https://hg.mozilla.org/users/gszorc_mozilla.com/hg/rev/zstd" target="_blank">https://hg.mozilla.org/users/g<wbr>szorc_mozilla.com/hg/rev/zstd</a> (see the p1 changeset for the C code).<br><br>It compiles, but that's about it. The compress API basically no-ops (I need to plug in iterator foo). The decompress API segfaults and the API needs refined. It's also my first time writing a Python C extension, so I'm sure I'm doing several things wrong. And I know the style doesn't match Mercurial conventions. I'm not sure if I should strive for tailoring this to Mercurial's usage or try to release it as a standalone package...<br><br></div><div>If anyone wants to take the code and run with it, go for it. I can stamp another license on the code if someone asks.<br><br></div><div>I'd also like to invite a larger discussion around supporting zstd in the official Mercurial distribution. It seems like an all-around better compression format than zlib and supporting zstd seems like a relatively easy way to gain significant performance and size efficiency wins on many operations.<br></div></div>
<br></div></div>______________________________<wbr>_________________<br>
Mercurial-devel mailing list<br>
<a href="mailto:Mercurial-devel@mercurial-scm.org" target="_blank">Mercurial-devel@mercurial-scm.<wbr>org</a><br>
<a href="https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel" rel="noreferrer" target="_blank">https://www.mercurial-scm.org/<wbr>mailman/listinfo/mercurial-dev<wbr>el</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div></div>