jmix-framework / jmix

Jmix framework
https://www.jmix.io
Apache License 2.0
561 stars 118 forks source link

Cache generated column components #536

Closed alexbudarov closed 5 months ago

alexbudarov commented 4 years ago

e.g. see these topics

https://www.cuba-platform.ru/discuss/t/7-1-chrezmernoe-srabatyvanie-generatorov-kolonok-pri-izmenenii-zapisi/4187/2

https://www.cuba-platform.com/discuss/t/generated-columns-are-re-calculated-every-time-when-i-scroll-in-browse-screen/9917/2

It is one of common CUBA GUI library performance/usability problems. Every developer who codes generated columns - implements them wrong for the first time. People make heavy calculations or requests to database in column generation methods.

Note that even CUBA documentation says nothing about this problem.

In Sherlock I had to instruct every newbie developer to load / calculate data beforehand, not inside of column generator (in desktop client problem becomes even worse because of the network lag).

With time it becomes obvious that if 90% of developers make mistake in one particular API place - then problem is not with developers, the problem is in this place.

Asking every developer to implement his/her own caching solution is not fair.

CUBA tables should use some caching rules and re-use results of column generators. E.g. until item is changed, or collection is refreshed or entity's property used as column ID is changed.

alexbudarov commented 4 years ago

another example https://www.cuba-platform.ru/discuss/t/generacziya-kolonok/4585

glebfox commented 5 months ago

DataGrid supports lightweight renderers, so no need to create a UI component to display a custom text in a column.