Skip to content

Commit

Permalink
Fix perf
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Hulette committed Jan 24, 2018
1 parent 54d4f5b commit a00415e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions js/perf/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ function createDataFrameDirectCountTest(table, column, test, value) {
let numBatches = batches.length;
for (let batchIndex = -1; ++batchIndex < numBatches;) {
// load batches
const { numRows, columns } = batches[batchIndex];
const vector = columns[colidx];
const batch = batches[batchIndex];
const vector = batch.getChildAt(colidx);
// yield all indices
for (let index = -1; ++index < numRows;) {
for (let index = -1; ++index < batch.length;) {
sum += (vector.get(index) >= value);
}
}
Expand All @@ -159,10 +159,10 @@ function createDataFrameDirectCountTest(table, column, test, value) {
let numBatches = batches.length;
for (let batchIndex = -1; ++batchIndex < numBatches;) {
// load batches
const { numRows, columns } = batches[batchIndex];
const vector = columns[colidx];
const batch = batches[batchIndex];
const vector = batch.getChildAt(colidx);
// yield all indices
for (let index = -1; ++index < numRows;) {
for (let index = -1; ++index < batch.length;) {
sum += (vector.get(index) === value);
}
}
Expand All @@ -173,7 +173,7 @@ function createDataFrameDirectCountTest(table, column, test, value) {

return {
async: true,
name: `name: '${column}', length: ${table.numRows}, type: ${table.columns[colidx].type}, test: ${test}, value: ${value}\n`,
name: `name: '${column}', length: ${table.numRows}, type: ${table.getColumnAt(colidx).type}, test: ${test}, value: ${value}\n`,
fn: op
};
}
Expand All @@ -183,7 +183,7 @@ function createDataFrameCountByTest(table, column) {

return {
async: true,
name: `name: '${column}', length: ${table.numRows}, type: ${table.columns[colidx].type}\n`,
name: `name: '${column}', length: ${table.numRows}, type: ${table.getColumnAt(colidx).type}\n`,
fn() {
table.countBy(column);
}
Expand All @@ -204,7 +204,7 @@ function createDataFrameFilterCountTest(table, column, test, value) {

return {
async: true,
name: `name: '${column}', length: ${table.numRows}, type: ${table.columns[colidx].type}, test: ${test}, value: ${value}\n`,
name: `name: '${column}', length: ${table.numRows}, type: ${table.getColumnAt(colidx).type}, test: ${test}, value: ${value}\n`,
fn() {
df.count();
}
Expand Down

0 comments on commit a00415e

Please sign in to comment.