Rust extensions: the next step

Georges Racinet gracinet at anybox.fr
Wed Oct 17 16:45:08 UTC 2018


Hi all,

first, many thanks for the Stockholm sprint, it was my first interaction
with the Mercurial community, and it's been very welcoming to me.

I've been pursuing some experiments I started then to convert the Rust
bindings I've done in the patch series about ancestry iteration (now
landed) to a proper Python extension, using the cpython crate and Python
capsules. In short, it works.

Early benchmarking shows that it's a few percent slower than the direct
bindings through C code, which I think is acceptable compared to the
other benefits (clearer integration, easier to generalise, no C code at
all).

The end result is a unique shared library importable as
'mercurial.rustext', which is itself made of several submodules, ie, one
can do:

   from mercurial.rustext.ancestor import AncestorsIterator

It will take me some more time, though, to get that experiment into a
reviewable state (have to switch soon to other, unrelated, works) and
we're too close to the freeze anyway, but if someone wants to see it, I
can share it right away.

Also, I could summarize some of these thoughts on the Oxidation wiki
page. Greg, are you okay with that ?

Regards,

-- 
Georges Racinet
Anybox SAS, http://anybox.fr
Téléphone: +33 6 51 32 07 27
GPG: B59E 22AB B842 CAED 77F7 7A7F C34F A519 33AB 0A35, sur serveurs publics




More information about the Mercurial-devel mailing list