summaryrefslogtreecommitdiff
path: root/preload-index.c
diff options
context:
space:
mode:
Diffstat (limited to 'preload-index.c')
-rw-r--r--preload-index.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/preload-index.c b/preload-index.c
index 2541b307e8..9e7152ab14 100644
--- a/preload-index.c
+++ b/preload-index.c
@@ -5,6 +5,7 @@
#include "pathspec.h"
#include "dir.h"
#include "fsmonitor.h"
+#include "config.h"
#include "progress.h"
#ifdef NO_PTHREADS
@@ -105,17 +106,17 @@ static void preload_index(struct index_state *index,
{
int threads, i, work, offset;
struct thread_data data[MAX_PARALLEL];
- uint64_t start = getnanotime();
struct progress_data pd;
if (!core_preload_index)
return;
threads = index->cache_nr / THREAD_COST;
- if ((index->cache_nr > 1) && (threads < 2) && getenv("GIT_FORCE_PRELOAD_TEST"))
+ if ((index->cache_nr > 1) && (threads < 2) && git_env_bool("GIT_TEST_PRELOAD_INDEX", 0))
threads = 2;
if (threads < 2)
return;
+ trace_performance_enter();
if (threads > MAX_PARALLEL)
threads = MAX_PARALLEL;
offset = 0;
@@ -148,7 +149,7 @@ static void preload_index(struct index_state *index,
}
stop_progress(&pd.progress);
- trace_performance_since(start, "preload index");
+ trace_performance_leave("preload index");
}
#endif