Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita7984bc

Browse files
tyao1facebook-github-bot
authored andcommitted
Speed upwatchman_query_time_before_subscribe
Reviewed By: evanyeungDifferential Revision: D57935802fbshipit-source-id: 3f28f2b46014c2573111c3e5f3ce166070f08d3b
1 parent7fbe4d5 commita7984bc

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

‎compiler/crates/relay-compiler/src/file_source/watchman_file_source.rs

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ impl<'config> WatchmanFileSource<'config> {
7272
CompilerState::deserialize_from_file(saved_state_path)
7373
})?;
7474
let query_timer = perf_logger_event.start("watchman_query_time");
75-
let file_source_result =self.query_file_result(compiler_state.clock.clone()).await?;
75+
let file_source_result =self
76+
.query_file_result(compiler_state.clock.clone(),false)
77+
.await?;
7678
perf_logger_event.stop(query_timer);
7779
compiler_state
7880
.pending_file_source_changes
@@ -133,7 +135,7 @@ impl<'config> WatchmanFileSource<'config> {
133135
perf_logger_event:&implPerfLogEvent,
134136
perf_logger:&implPerfLogger,
135137
) ->Result<CompilerState>{
136-
let file_source_result =self.query_file_result(None).await?;
138+
let file_source_result =self.query_file_result(None,false).await?;
137139
let compiler_state = perf_logger_event.time("from_file_source_changes", ||{
138140
CompilerState::from_file_source_changes(
139141
self.config,
@@ -157,7 +159,9 @@ impl<'config> WatchmanFileSource<'config> {
157159
let expression =get_watchman_expr(self.config);
158160

159161
let query_timer = perf_logger_event.start("watchman_query_time_before_subscribe");
160-
let file_source_result =self.query_file_result(compiler_state.clock.clone()).await?;
162+
let file_source_result =self
163+
.query_file_result(compiler_state.clock.clone(),true)
164+
.await?;
161165
perf_logger_event.stop(query_timer);
162166

163167
let query_timer = perf_logger_event.start("watchman_query_time_subscribe");
@@ -185,7 +189,11 @@ impl<'config> WatchmanFileSource<'config> {
185189

186190
/// Internal method to issue a watchman query, returning a raw
187191
/// WatchmanFileSourceResult.
188-
asyncfnquery_file_result(&self,since_clock:Option<Clock>) ->Result<FileSourceResult>{
192+
asyncfnquery_file_result(
193+
&self,
194+
since_clock:Option<Clock>,
195+
omit_changed_files:bool,
196+
) ->Result<FileSourceResult>{
189197
let expression =get_watchman_expr(self.config);
190198
debug!(
191199
"WatchmanFileSource::query_file_result(...) get_watchman_expr = {:?}",
@@ -197,6 +205,8 @@ impl<'config> WatchmanFileSource<'config> {
197205
// passed as the request params
198206
let request =if since_clock.is_some(){
199207
QueryRequestCommon{
208+
omit_changed_files,
209+
empty_on_fresh_instance: omit_changed_files,
200210
expression:Some(expression),
201211
since: since_clock,
202212
..Default::default()
@@ -207,6 +217,8 @@ impl<'config> WatchmanFileSource<'config> {
207217
.map(PathGeneratorElement::RecursivePath)
208218
.collect();
209219
QueryRequestCommon{
220+
omit_changed_files,
221+
empty_on_fresh_instance: omit_changed_files,
210222
expression:Some(expression),
211223
path:Some(query_roots),
212224
..Default::default()
@@ -257,7 +269,7 @@ impl<'config> WatchmanFileSource<'config> {
257269
);
258270
let query_timer = perf_logger_event.start("watchman_query_time_try_saved_state");
259271
let file_source_result =self
260-
.query_file_result(Some(scm_since))
272+
.query_file_result(Some(scm_since),false)
261273
.await
262274
.map_err(|_|"query failed")?;
263275
perf_logger_event.stop(query_timer);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp