B4J Question [B4XTable] Too Slow Or Need Better Algorithm? (Fastest Grid Able to Keep Up With Fast Changes)

cklester

Well-Known Member
Licensed User
I've got some data coming into my app from a websocket. It's coming in fast! Too fast! I need a grid that can keep up with the updates, and it seems B4XTable ain't gonna cut it.

I've modified the B4XTable Editable example to simulate this. See attached project. (Use the buttons to toggle the various streaming speeds...)

It handles "Easy Mode" streaming easily. Data changes every half-second, and the UI is responsive.

It barely keeps up with "Difficult" streaming. Data changes... fast, and the UI is barely responsive.

It completely fails with "Impossible" streaming. Data changes... really fast, and the UI locks up and is non-responsive.

I tried it in Release as well as Debug, and both versions exhibit the same behavior.

So, the big question is:

What is the best approach to displaying this kind of streaming data in a table/grid format for B4J?
 

Attachments

  • b4xtable-speed-test.zip
    53.2 KB · Views: 132

cklester

Well-Known Member
Licensed User
Saying that B4XTable is too slow is incorrect.

To be fair, I did say "it seems," as I wasn't sure I was using B4XTable optimally.

You are doing something that B4XTable wasn't built for.

Which grid/table view should I use for this?

With that said, just by switching to RefreshNow it works fast enough with all your timers (in release mode of course).

Are you able to page through the table while at the Difficult and Impossible speeds? I can't, even in Release mode. Paging buttons are unresponsive.

Maybe my PC can't handle it...? I'm using an Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz with 16GM RAM.
 
Upvote 0

cklester

Well-Known Member
Licensed User
I tried using the Flex Grid (see attached project) from @Star-Dust .

You can see it's keeping up somewhat well with the impossible stream of data, but there are a few issues:

It is drawing over the prior cell contents. If I use invalidate, it blinks too much. It probably slows everything down as well.

Also, the columns do not expand to fill the space. I suspect I would have to put some code in some kind of resize event...

So, is there a way to invalidate or only redraw one cell? That might let me continue working on this project.

Otherwise, I'll have to come up with more "clever" ways to display this data.
 

Attachments

  • flex-grid-speed-test.zip
    52.7 KB · Views: 117
Upvote 0

cklester

Well-Known Member
Licensed User
Not sure what's different about this version, but it seems B4XTable handles impossible quite well now... Huh? What did I do?!
 

Attachments

  • b4xtable-speedy.zip
    53.3 KB · Views: 117
Upvote 0
Top