tabris-js
tabris-js copied to clipboard
Improve CollectionView performance
Performance for initial loading and when scrolling can be bad depending on the number of cells and widgets in the cell, especially on iOS.
See also https://github.com/eclipsesource/tabris-js/issues/1581#issuecomment-397772032
The performance is also relevant on Android when creating the initial set of cells. When starting to scroll and creating more cells can lead to noticeable on Android. Can be observed in the tabris-js-app.
Possibly improvement could be to refine the protocol. eg.
cellType: {
type: 'any', // string|function,
default: null,
set(name, value) {
if (value !== this.cellType) {
this._storeProperty(name, value);
this._nativeSet(
'cellType',
value instanceof Function
? index => encodeCellType(value(index))
: value
);
this._needsReload = true;
}
}
},
cellHeight: {
type: 'any', // natural|auto|function
default: 'auto',
set(name, value) {
if (value !== this.cellHeight) {
this._storeProperty(name, value);
this._nativeSet(
'cellHeight',
value instanceof Function
? (index, type) => encodeCellHeight(value(index, type))
: value
);
this._needsReload = true;
}
}
},
Also related: https://github.com/eclipsesource/tabris-js/issues/511