ArthurSonzogni / FTXUI

:computer: C++ Functional Terminal User Interface. :heart:
MIT License
6.64k stars 399 forks source link

[question] render only changed component #137

Closed naveenvhegde closed 3 years ago

naveenvhegde commented 3 years ago

Hi, I came across this good library. I am thinking to write a coinwatch tui. mostly data source will be websocket. something like fx dashboard. is it possible to render the only box instead of whole laytout from other thread ? I see screen.Post(...) seems to render everything.

Please correct me If I am wrong, asking for suggestion best way to layout this fast ticking data.

ArthurSonzogni commented 3 years ago

The UI is drawn when new events have been added, and the queue has been emptied. This is why we use PostEvent(Event:Custom) => to force rendering a new frame.

I believe you shouldn't have to worry about performance. If 1000 events are sent at the same time, we won't render 1000 frame. Instead, we will empty the list of event, and then render one frame.

Do you perceive any performance issues?

naveenvhegde commented 3 years ago

@ArthurSonzogni thanks. I have yet to start the project. If we render only level 1, bid and ask, then there might not be a performance issue. if need to render l2 depth of market data, then it will have impact - because data changes in sub second interval. Initially I will conflate the data from producer thread. Let's see how it goes.

Many thanks.

naveenvhegde commented 3 years ago

closing for now.