wadpac / GGIRread

Functions for reading accelerometer data files
https://CRAN.R-project.org/package=GGIRread
Apache License 2.0
5 stars 3 forks source link

speed up readAxivity #14

Closed vincentvanhees closed 1 year ago

vincentvanhees commented 2 years ago

I do not have time for this at the moment, but creating this as a note for the future or for others who may want to help do this work.

GGIRread::readAxivity currently seems to be the slowest of the data reading functions used by GGIR.

One possible quick speed gain would be to replace as.POSIXct by fasttime::fastPOSIXct. I just tested and it provides a 12% speed increase for reading the first 24 hours of the data. It seems, however, that more time goes into reading data chunks further down in the data.

However, it may be worthwhile refactoring the entire function. Reference points for that may be:

vincentvanhees commented 1 year ago