From 9769773e59d50c12e4c7b9005e0343358bdb7771 Mon Sep 17 00:00:00 2001 From: Paul Taylor Date: Thu, 25 Jan 2018 14:12:45 -0800 Subject: [PATCH] fix vector perf tests --- js/perf/index.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/js/perf/index.js b/js/perf/index.js index 98f6dfb4000d0..7cce871a4c1c8 100644 --- a/js/perf/index.js +++ b/js/perf/index.js @@ -33,11 +33,11 @@ for (let { name, buffers } of require('./table_config')) { const sliceToArraySuiteName = `Slice toArray "${name}" vectors`; suites.push(createTestSuite(parseSuiteName, createFromTableTest(name, buffers))); suites.push(createTestSuite(parseSuiteName, createReadBatchesTest(name, buffers))); - const table = Table.from(buffers); - suites.push(...table.columns.map((vector, i) => createTestSuite(getByIndexSuiteName, createGetByIndexTest(vector, table.schema.fields[i].name)))); - suites.push(...table.columns.map((vector, i) => createTestSuite(iterateSuiteName, createIterateTest(vector, table.schema.fields[i].name)))); - suites.push(...table.columns.map((vector, i) => createTestSuite(sliceToArraySuiteName, createSliceToArrayTest(vector, table.schema.fields[i].name)))); - suites.push(...table.columns.map((vector, i) => createTestSuite(sliceSuiteName, createSliceTest(vector, table.schema.fields[i].name)))); + const table = Table.from(buffers), schema = table.schema; + suites.push(...schema.fields.map((f, i) => createTestSuite(getByIndexSuiteName, createGetByIndexTest(table.getColumnAt(i), f.name)))); + suites.push(...schema.fields.map((f, i) => createTestSuite(iterateSuiteName, createIterateTest(table.getColumnAt(i), f.name)))); + suites.push(...schema.fields.map((f, i) => createTestSuite(sliceToArraySuiteName, createSliceToArrayTest(table.getColumnAt(i), f.name)))); + suites.push(...schema.fields.map((f, i) => createTestSuite(sliceSuiteName, createSliceTest(table.getColumnAt(i), f.name)))); } for (let {name, buffers, countBys, counts} of require('./table_config')) { @@ -173,7 +173,7 @@ function createDataFrameDirectCountTest(table, column, test, value) { return { async: true, - name: `name: '${column}', length: ${table.numRows}, type: ${table.getColumnAt(colidx).type}, test: ${test}, value: ${value}\n`, + name: `name: '${column}', length: ${table.length}, type: ${table.getColumnAt(colidx).type}, test: ${test}, value: ${value}\n`, fn: op }; } @@ -183,7 +183,7 @@ function createDataFrameCountByTest(table, column) { return { async: true, - name: `name: '${column}', length: ${table.numRows}, type: ${table.getColumnAt(colidx).type}\n`, + name: `name: '${column}', length: ${table.length}, type: ${table.getColumnAt(colidx).type}\n`, fn() { table.countBy(column); } @@ -204,7 +204,7 @@ function createDataFrameFilterCountTest(table, column, test, value) { return { async: true, - name: `name: '${column}', length: ${table.numRows}, type: ${table.getColumnAt(colidx).type}, test: ${test}, value: ${value}\n`, + name: `name: '${column}', length: ${table.length}, type: ${table.getColumnAt(colidx).type}, test: ${test}, value: ${value}\n`, fn() { df.count(); }