Skip to content

neuronlistz - fast access to neuronlists stored as zip files#456

Merged
jefferis merged 16 commits intomasterfrom
feature/fast-nlzip
Mar 18, 2021
Merged

neuronlistz - fast access to neuronlists stored as zip files#456
jefferis merged 16 commits intomasterfrom
feature/fast-nlzip

Conversation

@jefferis
Copy link
Copy Markdown
Collaborator

@jefferis jefferis commented Mar 17, 2021

  • neurons are best stored in the recent qs format
write.neurons(Cell07PNs[1:5], tf2, format='qs', include.data.frame = T)

You can also embed the metadata in the zip so that one file should contain everything.

For 3GB files, I get 20ms per record random access. Faster performance (order 5ms) could be obtained with https://github.com/jefferis/razip. Reading sequential groups of files is much faster.

* 3 cores can reduce time ~ 40% in my tests
* I will remove some of this but useful for testing purposes
* this is about 10x faster than gzip for raw compression speed in my tests
* including the overhead of writing files etc
* this is so fast that it doesn't seem to pay to parallelise writing,
  so I am tempted to revert support for that
* I think this is probably preferable since there is a CRAN package supporting this
  rather than it being a roll your own solution
* also does actually give time space savings of 5-15% and does not require memory allocation within R
* currently writes in rds format
* should probably consider csv e.g. if writing neurons in SWC rather than rds format
* we will not end up using most of these ...
* just unzipping to tmp works best for small to medium files
@jefferis
Copy link
Copy Markdown
Collaborator Author

@alexanderbates first pass at storing neuronlists as efficient zip files for random access

@coveralls
Copy link
Copy Markdown

coveralls commented Mar 17, 2021

Coverage Status

Coverage increased (+0.08%) to 81.396% when pulling 0077686 on feature/fast-nlzip into 7f665de on master.

@jefferis jefferis merged commit faadebf into master Mar 18, 2021
@jefferis jefferis deleted the feature/fast-nlzip branch March 18, 2021 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants