data structure for time series analysis in Java Script

Viewed 529

I am working on a electron / node.js app, which reads in time series data from excel files and do some analysis with the time series data. It may sound odd to process large time series data with Javascript.

The time series data may contain up to millions of records.

The data structure I am currently using is an array of objects, looks like:

var data = [{
            Time: , //a Date() value, the time stamp
            psi: //a number, the pressure value at the time
            }, ...]

Operation to the time series data includes:

  • copy,
  • smooth the data,
  • delete some points,
  • bisection (given a time stamp, find the location in the array),
  • find local maximum/minimum within a time range,
  • calculate average pressure values within a time range
  • etc.

The current array of object may prone to some issues. I saw some was suggesting use two separate array to store time stamp and pressure separately.

Just wondering, from speed / robustness point of view, what's a good data structure for processing time series in Javascript?

0 Answers
Related