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 of a content renderer for the DynamicParagraph #412

Closed
igorepst opened this issue Nov 11, 2021 · 10 comments · Fixed by #413
Closed

Performance of a content renderer for the DynamicParagraph #412

igorepst opened this issue Nov 11, 2021 · 10 comments · Fixed by #413

Comments

@igorepst
Copy link
Contributor

The performance of a content renderer for the DynamicParagraph (I imagine the same will hold for DynamicList and DynamicTable) is pretty bad. Please use the attached minimal config file by running xplr -c ~/xplr.conf.txt /usr/bin
xplr.conf.txt
(the extension was changed from lua to txt to suit GitHub requirements, but you don't even need to change it back)
The file has a DynamicParagraph with a renderer that returns some static string. Nevertheless, when I open /usr/bin with 3756 files and just press and hold 'arrow down', the scroll is super jerky. If, however, you comment the DynamicParagraph and uncomment StaticParagraph, the scrolling is smooth as it should be.

scroll.mp4
@sayanarijit
Copy link
Owner

Runs almost fine on my machine. I'll try it on an old machine.

@sayanarijit
Copy link
Owner

Ah I see... number of files is the issue.

@sayanarijit
Copy link
Owner

Not good... We should pass only the visible nodes in the Lua function.

@igorepst
Copy link
Contributor Author

Yes, exactly, the number of files is what makes a difference, sorry for not being clear enough, as my laptop is not so old ;)

@sayanarijit
Copy link
Owner

🙊

@sayanarijit
Copy link
Owner

sayanarijit commented Nov 12, 2021

Not an easy fix. Need to rethink the API. I don't want to break existing the API, so I'll probably create a new API. But this issue will stay for a while.

@sayanarijit
Copy link
Owner

Note: Today I tried to cache mlua::Value of the directory nodes, but that didn't work. Which means, caching probably isn't a solution.

@sayanarijit
Copy link
Owner

Finally, found another hack based on caching. Not very pretty, but gets the job done. @igorepst pls test if possible.

@igorepst
Copy link
Contributor Author

I will, although a bit later. Tnx!

sayanarijit added a commit that referenced this issue Nov 15, 2021
@igorepst
Copy link
Contributor Author

Seems it works good :)

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

Successfully merging a pull request may close this issue.

2 participants