rich icon indicating copy to clipboard operation
rich copied to clipboard

Investigate Mypyc for Rich

Open willmcgugan opened this issue 3 years ago • 3 comments

It may be feasible to compile part of all of Rich with mypyc. We should investigate that.

From what I understand, a mypyc Rich wouldn't support "python -m rich.*" which would be a deal-breaker since that's a much loved feature. However we could get much of the benefits from a mypyc version of some critical files, like segment.py.

willmcgugan avatar Apr 29 '22 12:04 willmcgugan

Just need to know how plausible it is right now. Maybe Textual can import this "crich". Alternatively, could we extract the slower parts of Rich in to their own lib?

willmcgugan avatar Jun 07 '22 10:06 willmcgugan

@willmcgugan Should we close this?

darrenburns avatar Jul 13 '22 13:07 darrenburns

Let's leave that up for now. I have a suspicion that some of the optimisations I've made actually work against use when compiling with mypyc (and Cython). I'd like to do a deep dive at some point to figure out why.

willmcgugan avatar Jul 13 '22 13:07 willmcgugan

I hope we solved your problem.

If you like using Rich, you might also enjoy Textual

github-actions[bot] avatar Dec 24 '22 10:12 github-actions[bot]