You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.
Since #49 landed, index entries store content size data. This data is critically important when it comes to quickly making decisions about whether to stream or do bulk operations on content.
The missing piece now is that content-addressed interactions don't have a way to figure out the size of the data they're about to process.
So, hasContent, which is usually the entry point to this, should return size information for the file if it happens to find it, along with the SRI. The change required for this is mostly pretty small: lib/content/read.js is the one with hasContent, and that function already calls out to fs.lstat. All that's left is to thread the data through (probably wrap the sri return value so you get {sri, stat}. hasContent itself, when it succeeds, should return an object that looks like {sri, size}. Otherwise, false.
Since I expect it to be a relatively small patch, I've marked this as a good starter issue. Also one that will have some seriously awesome performance impact in the libraries using it! Very soon, and very tangibly! make-fetch-happen and pacote already have places to drop this in for speeeeedz.
The text was updated successfully, but these errors were encountered:
Fixes#87
BREAKING CHANGE: hasContent now returns an object with `{sri, size}` instead of `sri`. Use `result.sri` anywhere that needed the old return value.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Since #49 landed, index entries store content size data. This data is critically important when it comes to quickly making decisions about whether to stream or do bulk operations on content.
The missing piece now is that content-addressed interactions don't have a way to figure out the size of the data they're about to process.
So,
hasContent
, which is usually the entry point to this, should return size information for the file if it happens to find it, along with the SRI. The change required for this is mostly pretty small:lib/content/read.js
is the one withhasContent
, and that function already calls out tofs.lstat
. All that's left is to thread the data through (probably wrap thesri
return value so you get{sri, stat}
.hasContent
itself, when it succeeds, should return an object that looks like{sri, size}
. Otherwise, false.Since I expect it to be a relatively small patch, I've marked this as a good
starter
issue. Also one that will have some seriously awesome performance impact in the libraries using it! Very soon, and very tangibly! make-fetch-happen and pacote already have places to drop this in for speeeeedz.The text was updated successfully, but these errors were encountered: