From ae1ba2af3c0dc45de074285f0e0a8440cf2895ec Mon Sep 17 00:00:00 2001 From: David Sherret Date: Sat, 1 Apr 2023 10:12:40 -0400 Subject: perf(check): faster source hashing (#18534) --- cli/tools/check.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'cli/tools') diff --git a/cli/tools/check.rs b/cli/tools/check.rs index 12f9d06b5..804519e84 100644 --- a/cli/tools/check.rs +++ b/cli/tools/check.rs @@ -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, -- cgit v1.2.3