Question: why not use Cython or mypyc for all the code?
Have you checked borgbackup docs, FAQ, and open Github issues?
Yes
Is this a BUG / ISSUE report or a QUESTION?
QUESTION
Describe the problem you're observing.
Hello. My assumption is that .pyx files are Cython files while .py are regular Python files. I am curious as to why you would want to compile only specific parts with Cython? Wouldn't it make sense to compile everything?
We use Cython for:
- interfacing to C libraries, external as well as self-made
- some performance critical code (if not using even C for that)
I never tried using Cython for all.
Using it for the not performance-critical parts of the code might have more disadvantages (compile time, binary size, debugging) than advantages though.
What might be more interesting is to identify more parts of the code that are perf critical.
What might be more interesting is to identify more parts of the code that are perf critical.
What are the tools used with Python for this? As a C/C++ developer I am mainly familiar with callgrind tool from valgrind project.
It might be worth looking at mypyc if you are looking at something to process the rest of the code.
https://mypyc.readthedocs.io/en/latest/introduction.html
Good idea. But:
- we do not have that many type hints in the code yet
- mypy is not integrated into our workflow yet, see my still open mypy PR. #6862
- mypyc is alpha still, guess we want to wait a bit until it is at least beta.
When I experimented with mypyc on pluggy it yielded horrible results in terms of reliability, not something I'd Want in backups
Do you mean in terms of correctness or in terms of reliability for speed ups ?
I can imagine pluggy being more on the tricky end for something like mypyc so I'm sure they would welcome the bug reports.