Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance tips? #1425

Open
davidbrochart opened this issue May 7, 2021 · 1 comment
Open

Performance tips? #1425

davidbrochart opened this issue May 7, 2021 · 1 comment

Comments

@davidbrochart
Copy link
Contributor

Thanks for this great library. I am using it in https://github.com/davidbrochart/nbterm, a Jupyter Notebook in the terminal. So far it works great, but I'm not sure I'm using prompt-toolkit right, and maybe I am abusing its flexibility at the cost of a loss in performance.
In nbterm, the complexity of the layout is directly linked to the number of cells in the notebook, and I have seen that it doesn't scale very well. I would have thought that cells not visible on the screen would not matter (because not rendered), but it looks like it does, e.g. if I have 100 cells but only 10 fit on the screen, then it's "as slow as" rendering these 100 cells. Even focusing on a cell gets slow (using up and down arrows), even if the layout doesn't have to be re-rendered.
Maybe I am doing something wrong, or my application is not well structured. So I was wondering, is there any common mistake you know of, that could explain this loss in performance? Or tips that generally help?
Thanks again!

@davidbrochart
Copy link
Contributor Author

@joouha has implemented a really nice ScrollingContainer that would be a great contribution to prompt-toolkit, see joouha/euporie#6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant