perf(check): faster source hashing (#18534)

This commit is contained in:
David Sherret 2023-04-01 10:12:40 -04:00 committed by GitHub
parent 23b9be7b37
commit ae1ba2af3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 48 deletions

View file

@ -89,10 +89,12 @@ pub fn check(
// to make tsc build info work, we need to consistently hash modules, so that
// tsc can better determine if an emit is still valid or not, so we provide
// that data here.
let hash_data = vec![
options.ts_config.as_bytes(),
version::deno().as_bytes().to_owned(),
];
let hash_data = {
let mut hasher = FastInsecureHasher::new();
hasher.write(&options.ts_config.as_bytes());
hasher.write_str(version::deno());
hasher.finish()
};
let response = tsc::exec(tsc::Request {
config: options.ts_config,