▦K2 Advanced GridsDeveloper Portal / 0.24
Documentation / Developer reference

Performance & limitations

Design responsive, predictable K2 SmartForms by understanding the client-side processing model, measuring representative workloads and choosing features appropriate to each ListView. This reference applies to Engine 1.0.0-beta.1.0.

Client-side processing model

K2 retrieves and renders its native ListView records. The engine discovers matching Runtime grids, reads DOM rows and cell metadata, and enhances those records in the browser. Filtering, grouping, pagination, aggregation and export do not fetch additional SmartObject records. Native K2 sorting or rules may independently cause server activity.

StageWhere work happensScaling consideration
K2 query and renderingK2 server, data source and browserQuery duration, payload, native rendering
Grid discovery and type detectionBrowser DOMLoaded rows, columns and matching grids
Filtering and groupingBrowserLoaded records, active filters, grouping depth and distinct values
Pagination and presentationBrowserExisting rows are hidden, not unloaded
ExportBrowser memoryExported rows × columns, formatting and worksheets

Pagination is not virtualization

Classic paging and Load More operate on records already present in the native ListView. They limit the displayed subset, not the number of underlying DOM records. Card View builds a separate presentation of eligible rows while retaining the native table. Neither feature provides server-side paging or a virtualized data source. If K2 itself retrieves only one page, Advanced Grids can operate only on that loaded portion. See Lesson 3 — Pagination / Load More and Lesson 13 — Card View.

Cost drivers and practical optimizations

FeatureCost driverRecommendation
Filtering / type detectionReading cell metadata across loaded records; category value enumerationRestrict source query; use text filters where high-cardinality categorical lists are impractical.
Aggregation / groupingMatching records, group tree and configured metricsUse only needed metrics and grouping levels; avoid grouping by unique identifiers.
Conditional formatting / visualizationRules, affected cells and scale calculationLimit rules and visualization to relevant columns.
AutoFitMeasures text and styles across loaded rowsUse explicit widths where predictable; avoid repeated AutoFit calls.
Pinning / merging / resizingDOM measurements and layout workPin only essential columns; merge only useful adjacent values.
CardsAdditional DOM and mapped fieldsKeep cards concise; use modest display page size.
CSV / XLSXCell extraction and serialization; XLSX XML, styles and ZIP bytesExport filtered records and necessary columns; disable optional sheets/formatting when not required.
Multiple ListViewsCombined DOM and processing workloadLoad only needed views, scope configuration and measure the whole form.

Engine observers monitor Runtime DOM changes and coalesce scheduled rendering using requestAnimationFrame. This reduces duplicate scheduling within a frame but does not make processing asynchronous or free. Avoid calling refresh repeatedly in loops or after every minor change; allow K2 to finish updating the view first. Some work, including merge rendering, can occur in later frames.

Known evidence and workload boundaries

The training application demonstrates 250 loaded purchase orders, 17 source columns and a typical page size of 10. Export diagnostics recorded 250 loaded, 50 filtered and 10 page records with nine visible columns. These are functional validation results, not latency, throughput or memory benchmarks. No measured maximum supported row count, concurrency capacity or SLA has been established for this Beta.

Runtime export scope diagnostic
Existing functional evidence: loaded, filtered and page export scopes. No timing measurement is implied.

Reproducible benchmark procedure

Use a non-production environment with representative data, columns, rules and browsers. Record K2 build, browser version, OS, hardware, configuration, dataset shape and network conditions. Compare a native baseline (extension not loaded) with basic and full configurations. Use identical queries and data; reload between configurations and separate cold and warm runs.

Loaded rows (proposed)BaselineBasicFull
250Native K2Filtering + pagingRepresentative production modules
500RepeatRepeatRepeat
1,000RepeatRepeatRepeat
2,500Repeat only if responsiveRepeat only if responsiveRepeat only if responsive

These are suggested test sizes, not certified capacities. Stop increasing the dataset if the browser becomes unresponsive or your application’s acceptance criteria are exceeded. Repeat each scenario at least five times after a warm-up; retain individual samples, median and worst observed time. Record errors and memory behavior. Use browser DevTools Performance and Network recordings to distinguish native data retrieval, scripting, layout and paint. For memory, use comparable heap snapshots before and after repeated interactions; avoid interpreting temporary allocation as a leak.

Runtime inventory

const ag = K2AdvancedGrids.instance;
console.table(ag.inspect().map(g => ({
  id: g.id,
  loadedRows: g.rows,
  detectedColumns: g.columns.length,
  matching: g.pagination?.matching,
  visible: g.pagination?.visible,
  mode: g.cardView.mode
})));

Detected columns are the engine's typed/filterable inventory, not necessarily every source or visible column. Inspect itself reads DOM metadata; do not include it inside a timed operation.

Measure synchronous refresh and export build

Run this in the browser console after the form is stable. Export must be enabled. The script benchmarks synchronous API calls only, without downloading files. It measures all configured grids for refresh, and the selected grid for exports. It does not measure deferred rendering, K2 server calls, download completion or Excel opening. Run separate tests for each scope and configuration. For large datasets start with a single iteration.

{
  const ag = K2AdvancedGrids.instance;
  const id = 'REPLACE_WITH_YOUR_AREAITEMID';
  const options = { scope: 'filtered', columns: 'visible' };
  const runs = 5;
  const results = [];
  const tests = [
    ['refresh (all grids)', () => ag.refresh()],
    ['CSV build', () => ag.buildCSV(id, options)],
    ['XLSX build', () => ag.buildXLSX(id, options)]
  ];
  for (const [operation, fn] of tests) {
    for (let i = 0; i < runs; i++) {
      const start = performance.now();
      const value = fn();
      const ms = performance.now() - start;
      if (value === null || value === false) {
        console.warn(operation, 'not available'); break;
      }
      results.push({ operation, run: i + 1,
        ms: Number(ms.toFixed(2)),
        records: value?.records,
        columns: value?.columns,
        bytes: value?.blob?.size ?? (typeof value?.text === 'string'
          ? new TextEncoder().encode(value.text).length : undefined)
      });
      await new Promise(resolve => setTimeout(resolve, 250));
    }
  }
  console.table(results);
}

The delay separates samples but does not guarantee browser idle state. Use a Performance trace for end-to-end user interaction timings (filter, group, page, cards, resize), including subsequent layout and paint. Record the time from user action to stable visible output. See JavaScript API.

Benchmark recording template

ScenarioRows / columnsMedian msWorst msNotes
Native initial load———Not measured
Enhanced initial load———Not measured
Filter apply———Not measured
Page change———Not measured
Grouping———Not measured
Table → Cards———Not measured
CSV build———Not measured
XLSX build———Not measured

Production design and security boundaries

  • Apply server-side search criteria and authorization before returning data to K2. Never use hidden columns, client filtering, disabled actions or card visibility as security controls.
  • When large reports are required, use a server-side reporting/export solution rather than loading all records into a browser solely for export.
  • Exports are built in memory; XLSX uses generated OOXML and an uncompressed ZIP package. Large workbooks can increase memory and processing time; formatting and additional worksheets may add cost.
  • Summary and group calculations describe the loaded/exported scope, not necessarily the full database. Validate numerical precision, date handling and Excel compatibility for the target data.
  • Preferences are browser-local; they are not a central profile service. Test representative refresh/reload behavior.
  • Validate each supported K2 build, browser, theme and module combination before rollout. No blanket compatibility or performance guarantee is implied.

Acceptance checklist

Define application-specific response-time and memory budgets with stakeholders. Validate native and enhanced configurations on representative end-user devices, including slow devices and multiple grids. Confirm that filtering, counts, actions and exports remain correct under load. Retain test results and a rollback plan. See Configuration reference, Native Excel export and Disclaimer.

Enlarged screenshot