D6594: RFC dirstatemap

Yuya Nishihara yuya at tcha.org
Mon Jul 8 10:12:03 EDT 2019


>   > I heard boxing a PyObject has measurable cost,
>   
>   Do you have a link to any benchmarks? I'd be interested.

No number. IIRC, Augie tried to implement a parser by using nom, which
was breezing fast, until converting parsed result back to PyObjects.
I think we also have some cached PyObjects in our C extension.

>   > so we might even want to keep the entire data backed by PyObjects 
>   > depending on how frequently the data will be exposed to Python world.
>   
>   How would we decouple hg-core and hg-cpython then?

By defining data-layer interface as trait?

It might be less safe because of 'py' handle of rust-cpython, but if we
plan to switch to PyO3, maybe we can ignore the issue for the time being.

> If Python expects references to big objects (within `propertycache` for
> instance), we still need to exchange a fair bit of data from Rust if Rust
> does the heavy lifting.

(I read "big" as "many".)

Yes, so we'll probably want to minimize the data exchanged between Rust
and Python. This means we'll eventually move more logic to Rust side, which
hopefully reduce the number of elements to be exposed through the iterator
interface. Until then, it might be better to move iterator-heavy objects
to CPython/PyO3 layer. Just my guess.


More information about the Mercurial-devel mailing list