Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated benchmarks, removed IS_DELTA flag #533

Merged
merged 1 commit into from
Apr 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/perspective-cli/perspective
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env node
#!/usr/bin/env node --max-old-space-size=8192
/* eslint no-var: 0 */

require("@jpmorganchase/perspective-cli");
require("@jpmorganchase/perspective-cli");
16 changes: 6 additions & 10 deletions packages/perspective/bench/js/bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const path = require("path");

const args = process.argv.slice(2);
const LIMIT = args.indexOf("--limit");
const IS_DELTA = args.indexOf("--delta");

const multi_template = (xs, ...ys) => ys[0].map((y, i) => [y, xs.reduce((z, x, ix) => (ys[ix] ? z + x + ys[ix][i] : z + x), "")]);

Expand All @@ -29,7 +28,11 @@ const RUN_TEST = fs.readFileSync(path.join(__dirname, "browser_runtime.js")).toS

async function run_version(browser, url, is_delta = false) {
let page = await browser.newPage();
page.on("console", msg => console.log(` ${msg.type() === "error" ? " !" : "->"} ${msg.text()}`));
page.on("console", msg => {
if (msg.type() !== "warning") {
console.log(` ${msg.type() === "error" ? " !" : "->"} ${msg.text()}`);
}
});
page.on("pageerror", msg => console.log(` -> ${msg.message}`));

await page.setContent(`<html><head><script src="${url}" async></script><script>${RUN_TEST}</script></head><body></body></html>`);
Expand Down Expand Up @@ -67,13 +70,6 @@ async function run() {
}
}

if (IS_DELTA !== -1) {
// Only run delta tests for master
psp_urls = [URLS[0]];
benchmark_name = "delta_benchmark";
is_delta = true;
}

let data = [],
version_index = 1;
for (let [version, url] of psp_urls) {
Expand All @@ -87,7 +83,7 @@ async function run() {
version_index++;
data = data.concat(bins);
fs.writeFileSync(path.join(__dirname, "..", "..", "build", `${benchmark_name}.json`), JSON.stringify(transpose(data)));
fs.writeFileSync(path.join(__dirname, "..", "..", "build", `${benchmark_name}.html`), fs.readFileSync(path.join(__dirname, "..", "html", `${benchmark_name}s.html`)).toString());
fs.writeFileSync(path.join(__dirname, "..", "..", "build", `${benchmark_name}.html`), fs.readFileSync(path.join(__dirname, "..", "html", `${benchmark_name}.html`)).toString());

await browser.close();
}
Expand Down
52 changes: 11 additions & 41 deletions packages/perspective/bench/js/browser_runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,30 +156,6 @@ async function* run_on_update_cases(table, config, mode) {
await view.delete();
}

// Run collections of cases

async function* run_all_delta_cases() {
const worker = window.perspective.worker();
await wait_for_perspective();

// eslint-disable-next-line no-unused-vars
const {csv, arrow, rows, columns} = await get_data(worker);

const table = worker.table(rows);
await table.schema();

const aggregate = AGG_OPTIONS[0];
for (const row_pivots of ROW_PIVOT_OPTIONS) {
for (const column_pivots of COLUMN_PIVOT_OPTIONS) {
const config = {aggregate, row_pivots, column_pivots};

yield* run_on_update_cases(table, config, "none");
yield* run_on_update_cases(table, config, "rows");
yield* run_on_update_cases(table, config, "pkey");
}
}
}

async function* run_all_cases() {
const worker = window.perspective.worker();
await wait_for_perspective();
Expand All @@ -206,38 +182,32 @@ async function* run_all_cases() {
}
}
}
}

// Run entire test suite
const aggregate = AGG_OPTIONS[0];
for (const row_pivots of ROW_PIVOT_OPTIONS) {
for (const column_pivots of COLUMN_PIVOT_OPTIONS) {
const config = {aggregate, row_pivots, column_pivots};

// eslint-disable-next-line no-unused-vars
async function run_delta_test() {
// eslint-disable-next-line no-undef
perspective = perspective.default || perspective;
try {
let results = [];
for await (let c of run_all_delta_cases()) {
results.push(c);
yield* run_on_update_cases(table, config, "none");
yield* run_on_update_cases(table, config, "rows");
yield* run_on_update_cases(table, config, "pkey");
}
return results;
} catch (e) {
console.error(e.message);
return [];
}
}

// Run entire test suite

// eslint-disable-next-line no-unused-vars
async function run_test() {
// eslint-disable-next-line no-undef
perspective = perspective.default || perspective;
let results = [];
try {
let results = [];
for await (let c of run_all_cases()) {
results.push(c);
}
return results;
} catch (e) {
console.error(e.message);
return [];
}
return results;
}