Skip to content

Commit a00415e

Browse files
author
Brian Hulette
committed
Fix perf
1 parent 54d4f5b commit a00415e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

js/perf/index.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,10 @@ function createDataFrameDirectCountTest(table, column, test, value) {
144144
let numBatches = batches.length;
145145
for (let batchIndex = -1; ++batchIndex < numBatches;) {
146146
// load batches
147-
const { numRows, columns } = batches[batchIndex];
148-
const vector = columns[colidx];
147+
const batch = batches[batchIndex];
148+
const vector = batch.getChildAt(colidx);
149149
// yield all indices
150-
for (let index = -1; ++index < numRows;) {
150+
for (let index = -1; ++index < batch.length;) {
151151
sum += (vector.get(index) >= value);
152152
}
153153
}
@@ -159,10 +159,10 @@ function createDataFrameDirectCountTest(table, column, test, value) {
159159
let numBatches = batches.length;
160160
for (let batchIndex = -1; ++batchIndex < numBatches;) {
161161
// load batches
162-
const { numRows, columns } = batches[batchIndex];
163-
const vector = columns[colidx];
162+
const batch = batches[batchIndex];
163+
const vector = batch.getChildAt(colidx);
164164
// yield all indices
165-
for (let index = -1; ++index < numRows;) {
165+
for (let index = -1; ++index < batch.length;) {
166166
sum += (vector.get(index) === value);
167167
}
168168
}
@@ -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.columns[colidx].type}, test: ${test}, value: ${value}\n`,
176+
name: `name: '${column}', length: ${table.numRows}, 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.columns[colidx].type}\n`,
186+
name: `name: '${column}', length: ${table.numRows}, 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.columns[colidx].type}, test: ${test}, value: ${value}\n`,
207+
name: `name: '${column}', length: ${table.numRows}, type: ${table.getColumnAt(colidx).type}, test: ${test}, value: ${value}\n`,
208208
fn() {
209209
df.count();
210210
}

0 commit comments

Comments
 (0)