Skip to content

Instantly share code, notes, and snippets.

@azulus
azulus / PostProcessor.py
Created December 4, 2015 19:15 — forked from Realio/PostProcessor.py
Creates a file called OP.csv with one line in it - Cycle Push Load Pull Load Push Average Pull Average
#!/usr/bin/env python
import os
import csv
#source_dir = "\\\gameshare2\IEB\Reliability\BRB-2015\\98-Non-FTE\\01-DataAndTestResults\\11-Headband\Data_Processor"
source_dir = "C:\cygwin64\home\Test Data"
#change source directory for testing
input_file_path = source_dir + "\IP.csv"
#can this be any .csv files?
var reducePath = function (x, y, entryOffset, rangeOffset, entryRequiredWall, entryDisallowedWall) {
var rangeEntryRequiredDirections = [entryDisallowedWall, OppositeDirections[entryDisallowedWall]];
var rangeEntryDisallowedDirections = [entryRequiredWall, OppositeDirections[entryRequiredWall]];
var endDisallowedDirections = [OppositeDirections[entryRequiredWall], OppositeDirections[entryDisallowedWall]];
var endRequiredDirections = [entryRequiredWall, entryDisallowedWall];
var tile = tiles[x][y];
var color = tile.color;
var entry = tiles[x+entryOffset[0]][y+entryOffset[1]];
// Tested in Node.js v0.10.2
// * RESULTS *
// native bind with context x 696,362 ops/sec ±2.23% (84 runs sampled)
// native bind with context and arg x 672,228 ops/sec ±1.90% (86 runs sampled)
// custom bind with context x 1,186,009 ops/sec ±1.21% (98 runs sampled)
// custom bind with context and arg x 1,202,547 ops/sec ±1.28% (94 runs sampled)
// Tested in Node.js v0.10.3
// * RESULTS *
// custom bind x 29,388,127 ops/sec ±1.46% (95 runs sampled)
// native bind x 636,295 ops/sec ±2.66% (81 runs sampled)
// custom bind invoke x 45,884,456 ops/sec ±1.19% (95 runs sampled)
// native bind invoke x 5,424,592 ops/sec ±1.76% (96 runs sampled)