Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider storing remote file cache metadata in same file as text #17707

Open
dsherret opened this issue Feb 10, 2023 · 0 comments
Open

Consider storing remote file cache metadata in same file as text #17707

dsherret opened this issue Feb 10, 2023 · 0 comments
Labels
perf performance related suggestion suggestions for new features (yet to be agreed)
Milestone

Comments

@dsherret
Copy link
Member

dsherret commented Feb 10, 2023

We're currently loading two files for each cached remote file.

One file contains the CachedUrlMetadata:

/// Cached metadata about a url.
#[derive(Serialize, Deserialize)]
pub struct CachedUrlMetadata {
  pub headers: HeadersMap,
  pub url: String,
  #[serde(default = "SystemTime::now")]
  pub now: SystemTime,
}

The other file contains the actual remote file source text.

We store them separately, which means we have to do two file reads per remote file when loading.

image
image

If we stored them together in the same file, then we could reduce the number of file reads we have to do from two to one per file.

This has some implications for deno info --json because we expose the "local" file. Related #17703

@dsherret dsherret added perf performance related suggestion suggestions for new features (yet to be agreed) labels Feb 10, 2023
@dsherret dsherret added this to the 2.0.0 milestone Feb 10, 2023
@dsherret dsherret changed the title Consider storing remote cache metadata in same file as remote file text Consider storing remote file cache metadata in same file as text Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf performance related suggestion suggestions for new features (yet to be agreed)
Projects
None yet
Development

No branches or pull requests

1 participant