Skip to content

Commit 9769773

Browse files
committed
fix vector perf tests
1 parent 272d293 commit 9769773

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

js/perf/index.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ for (let { name, buffers } of require('./table_config')) {
3333
const sliceToArraySuiteName = `Slice toArray "${name}" vectors`;
3434
suites.push(createTestSuite(parseSuiteName, createFromTableTest(name, buffers)));
3535
suites.push(createTestSuite(parseSuiteName, createReadBatchesTest(name, buffers)));
36-
const table = Table.from(buffers);
37-
suites.push(...table.columns.map((vector, i) => createTestSuite(getByIndexSuiteName, createGetByIndexTest(vector, table.schema.fields[i].name))));
38-
suites.push(...table.columns.map((vector, i) => createTestSuite(iterateSuiteName, createIterateTest(vector, table.schema.fields[i].name))));
39-
suites.push(...table.columns.map((vector, i) => createTestSuite(sliceToArraySuiteName, createSliceToArrayTest(vector, table.schema.fields[i].name))));
40-
suites.push(...table.columns.map((vector, i) => createTestSuite(sliceSuiteName, createSliceTest(vector, table.schema.fields[i].name))));
36+
const table = Table.from(buffers), schema = table.schema;
37+
suites.push(...schema.fields.map((f, i) => createTestSuite(getByIndexSuiteName, createGetByIndexTest(table.getColumnAt(i), f.name))));
38+
suites.push(...schema.fields.map((f, i) => createTestSuite(iterateSuiteName, createIterateTest(table.getColumnAt(i), f.name))));
39+
suites.push(...schema.fields.map((f, i) => createTestSuite(sliceToArraySuiteName, createSliceToArrayTest(table.getColumnAt(i), f.name))));
40+
suites.push(...schema.fields.map((f, i) => createTestSuite(sliceSuiteName, createSliceTest(table.getColumnAt(i), f.name))));
4141
}
4242

4343
for (let {name, buffers, countBys, counts} of require('./table_config')) {
@@ -173,7 +173,7 @@ function createDataFrameDirectCountTest(table, column, test, value) {
173173

174174
return {
175175
async: true,
176-
name: `name: '${column}', length: ${table.numRows}, type: ${table.getColumnAt(colidx).type}, test: ${test}, value: ${value}\n`,
176+
name: `name: '${column}', length: ${table.length}, type: ${table.getColumnAt(colidx).type}, test: ${test}, value: ${value}\n`,
177177
fn: op
178178
};
179179
}
@@ -183,7 +183,7 @@ function createDataFrameCountByTest(table, column) {
183183

184184
return {
185185
async: true,
186-
name: `name: '${column}', length: ${table.numRows}, type: ${table.getColumnAt(colidx).type}\n`,
186+
name: `name: '${column}', length: ${table.length}, type: ${table.getColumnAt(colidx).type}\n`,
187187
fn() {
188188
table.countBy(column);
189189
}
@@ -204,7 +204,7 @@ function createDataFrameFilterCountTest(table, column, test, value) {
204204

205205
return {
206206
async: true,
207-
name: `name: '${column}', length: ${table.numRows}, type: ${table.getColumnAt(colidx).type}, test: ${test}, value: ${value}\n`,
207+
name: `name: '${column}', length: ${table.length}, type: ${table.getColumnAt(colidx).type}, test: ${test}, value: ${value}\n`,
208208
fn() {
209209
df.count();
210210
}

0 commit comments

Comments
 (0)