Skip to content

Commit

Permalink
render items sample
Browse files Browse the repository at this point in the history
  • Loading branch information
lifeart committed Dec 22, 2023
1 parent efcae32 commit b80e515
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
26 changes: 19 additions & 7 deletions benchmark/benchmarks/krausest/lib/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createBenchmark } from '@glimmer-workspace/benchmark-env';
import { createBenchmark, createCell } from '@glimmer-workspace/benchmark-env';

import Application from './components/Application';
import ApplicationTemplate from './components/Application.hbs';
Expand All @@ -18,13 +18,25 @@ export default async function render(element, isInteractive) {

/** @type {{[name: string]: any}} */
const args = {
items: buildData(),
get items() {
return this.cell.get();
},
set items(value) {
this.cell.set(value);
}
};
enforcePaintEvent();
performance.mark('glimmer-render-1000-rows-start');
enforcePaintEvent();
await benchmark.render('Application', args, element, isInteractive);
performance.mark('glimmer-render-1000-rows-finished');
const cell = createCell(args, 'items', []);
args.cell = cell;
const app = await benchmark.render('Application', args, element, isInteractive);

await app('render-10000-items', () => {
args['items'] = buildData(10000);
});

await app('clear-10000-items', () => {
args['items'] = [];
});

enforcePaintEvent();
}

Expand Down
2 changes: 1 addition & 1 deletion bin/setup-bench.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const experimentBranchName =
const controlBranchName = process.env['CONTROL_BRANCH_NAME'] || 'main';
const markers =
process.env['MARKERS'] ||
'navigationStart,renderStart,renderEnd,glimmer-render-1000-rows-start,glimmer-render-1000-rows-finished';
'navigationStart,renderStart,renderEnd,render-10000-itemsStart,render-10000-itemsEnd,clear-10000-itemsStart,clear-10000-itemsEnd';
const fidelity = process.env['FIDELITY'] || '20';
const throttleRate = process.env['THROTTLE'] || '4';
const FORK_NAME = process.env['FORK_NAME'] || '';
Expand Down

0 comments on commit b80e515

Please sign in to comment.