Skip to content

Improve batched Column performance - #444

Merged
mvilliger merged 1 commit into
releases/27.1from
features/mvi/26.2/smartColumnPerformance
Sep 15, 2026
Merged

mvilliger merged 1 commit into
releases/27.1from
features/mvi/26.2/smartColumnPerformance

Conversation

@mvilliger

Copy link
Copy Markdown
Member

SmartColumns with batched LookupCall already collected all keys and then updated the cell text as soon as the async LookupCall completed. Therefore, there is only one promise for the LookupCall execution returning the texts for all keys.
Unfortunately the SmartColumn then splits this promise into one promise for each cell containing only the value for the specific cell. This leads to thousands of promises on large tables.
These promises are collected in the TableUpdateBuffer and removed as they resolve. This operation was O(n^2) as the buffer internally used an array to store the promises.

Processing lots of such promises together with the inefficient handling of the buffer leads to unnecessary computation time on the client. Because of some async overhead, executing a promise for each cell is significantly slower than executing one promise handling all cells. On large tables with thousands of rows and multiple SmartColumns this may sum up to several seconds just to process these promises.

This commit changes the following:

  • Introduce a helper class BatchCall to collect keys and using an async   batch callback executed for all the keys.
  • Column uses this new BatchCall in formatValue() if available. This   allows each column to support batch processing more easily.   Implementors only need to set the _batchFormat member defining the   batch callback.
  • The deferred Cell text update in batch mode always updates all texts   of the column instead of only one cell. Accordingly, _formatValue and   formatValue() in the async case now return all texts instead of only   the one for a single cell.
  • StaticLookupCall & LookupCallColumn now supports batching to benefit   from the new features.

410165, 399939

@mvilliger
mvilliger requested a review from cguglielmo September 9, 2026 12:38
Comment thread docs/modules/migration/partials/migration-guide-27.1.adoc Outdated
Comment thread docs/modules/migration/partials/migration-guide-27.1.adoc Outdated
Comment thread docs/modules/releasenotes/partials/release-notes-27.1.adoc Outdated
Comment thread docs/modules/releasenotes/partials/release-notes-27.1.adoc Outdated
SmartColumns with batched LookupCall already collected all keys and then
updated the cell text as soon as the async LookupCall completed.
Therefore, there is only one promise for the LookupCall execution
returning the texts for all keys.
Unfortunately the SmartColumn then splits this promise into one promise
for each cell containing only the value for the specific cell. This
leads to thousands of promises on large tables.
These promises are collected in the TableUpdateBuffer and removed as
they resolve. This operation was O(n^2) as the buffer internally used an
array to store the promises.

Processing lots of such promises together with the inefficient handling
of the buffer leads to unnecessary computation time on the client.
Because of some async overhead, executing a promise for each cell is
significantly slower than executing one promise handling all cells. On
large tables with thousands of rows and multiple SmartColumns this may
sum up to several seconds just to process these promises.

This commit changes the following:
- Introduce a helper class BatchCall to collect keys and using an async
  batch callback executed for all the keys.
- Column uses this new BatchCall in formatValue() if available. This
  allows each column to support batch processing more easily.
  Implementors only need to set the _batchFormat member defining the
  batch callback.
- The deferred Cell text update in batch mode always updates all texts
  of the column instead of only one cell. Accordingly, _formatValue and
  formatValue() in the async case now return all texts instead of only
  the one for a single cell.
- StaticLookupCall & LookupCallColumn now supports batching to benefit
  from the new features.

410165, 399939
@mvilliger
mvilliger force-pushed the features/mvi/26.2/smartColumnPerformance branch 2 times, most recently from 32a5b51 to ec7ec60 Compare September 15, 2026 09:42
@mvilliger
mvilliger merged commit e033e18 into releases/27.1 Sep 15, 2026
1 check passed
@mvilliger
mvilliger deleted the features/mvi/26.2/smartColumnPerformance branch September 15, 2026 10:36
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 this pull request may close these issues.

2 participants