packages/perspective/bench/js/browser_runtime.js
async function* run_table_cases(worker, data, test) {
    console.log(`Benchmarking \`${test}\``);
    try {
        for (let x = 0; x < ITERATIONS + TOSS_ITERATIONS; x++) {
            const start = performance.now();
            const table = worker.table(data.slice ? data.slice() : data);
            await table.size();
            if (x >= TOSS_ITERATIONS) {
                yield {
                    test,
                    time: performance.now() - start,
                    method: test,
                    row_pivots: "n/a",
                    column_pivots: "n/a",
                    aggregate: "n/a"
                };
            }
            await table.delete();
        }
    } catch (e) {
        console.error(`Benchmark ${test} failed`, e);
    }
}
async function* run_table_cases(worker, data, test) {
    console.log(`Benchmarking \`${test}\``);
    try {
        for (let x = 0; x < ITERATIONS + TOSS_ITERATIONS; x++) {
            const start = performance.now();
            const table = worker.table(data.slice ? data.slice() : data);
            await table.size();
            if (x >= TOSS_ITERATIONS) {
                yield {
                    test,
                    time: performance.now() - start,
                    method: test,
                    row_pivots: "n/a",
                    column_pivots: "n/a",
                    aggregate: "n/a"
                };
            }
            await table.delete();
        }
    } catch (e) {
        console.error(`Benchmark ${test} failed`, e);
    }
}
async function * run_table_cases ( worker , data , test ) { console . log ( ` \` ${ test } \` ` ) ; try { for ( let x = 0 ; x < ITERATIONS + TOSS_ITERATIONS ; x ++ ) { const start = performance . now ( ) ; const table = worker . table ( data . slice ? data . slice ( ) : data ) ; await table . size ( ) ; if ( x >= TOSS_ITERATIONS ) { yield { test , time : performance . now ( ) - start , method : test , row_pivots : "n/a" , column_pivots : "n/a" , aggregate : "n/a" } ; } await table . delete ( ) ; } } catch ( e ) { console . error ( ` ${ test } ` , e ) ; } }
Define benchmark cases
Define benchmark cases