-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Query EdenFS for File SHA1 instead of Performing a Full Read for Writ…
…ing Artifacts Summary: ## Current When deciding whether to write an artifact we read the full file into memory and compare it to the new contents. ## Problem Because Relay writes over 100K artifacts this is causing a serious strain. ## Solution Switch to using EdenFS that can provide quick access to the SHA-1 for comparison. https://www.internalfb.com/intern/wiki/EdenFS/guide-for-tool-authors/#what-is-faster-in-edenfs : Added a new config field for a specifying a artifact file hash fetch function for comparison instead of reading the entire file contents in the artifact writer. Reviewed By: tyao1 Differential Revision: D47752336 fbshipit-source-id: 16285414e883f4c519d4bd0e612ef662d2e9066f
- Loading branch information
1 parent
a8dc8a9
commit 95ec269
Showing
6 changed files
with
128 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
compiler/crates/relay-compiler/src/build_project/get_artifacts_file_hash_map.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
use futures::future::BoxFuture; | ||
use rustc_hash::FxHashMap; | ||
|
||
use super::Artifact; | ||
|
||
pub type GetArtifactsFileHashMapFn = Box< | ||
dyn Send | ||
+ Sync | ||
+ for<'a> Fn(&'a [Artifact]) -> BoxFuture<'a, Option<FxHashMap<String, Option<String>>>>, | ||
>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters