@@ -119,6 +119,7 @@ function download_cache_files(ssi, environment_path, progress_callback)
119119 n_done = 0
120120 n_total = length (to_download)
121121 progress_callback (" Downloading cache files..." , 0 )
122+ t0 = time ()
122123 for batch in Iterators. partition (to_download, 100 ) # 100 connections at a time
123124 @sync for pkg in batch
124125 @async begin
@@ -128,11 +129,14 @@ function download_cache_files(ssi, environment_path, progress_callback)
128129 yield ()
129130 n_done += 1
130131 percentage = round (Int, 100 * (n_done/ n_total))
131- progress_callback (" Downloading cache files..." , percentage)
132+ if percentage < 100
133+ progress_callback (" Downloading cache files..." , percentage)
134+ end
132135 end
133136 end
134137 end
135- progress_callback (" All cache files downloaded." , 100 )
138+ took = round (time () - t0, sigdigits = 2 )
139+ progress_callback (" All cache files downloaded (took $(took) s)." , 100 )
136140 end
137141 end
138142end
@@ -279,9 +283,12 @@ function load_project_packages_into_store!(ssi::SymbolServerInstance, environmen
279283 manifest === nothing && return
280284 uuids = values (deps (project))
281285 num_uuids = length (values (deps (project)))
286+ t0 = time ()
282287 for (i, uuid) in enumerate (uuids)
283288 load_package_from_cache_into_store! (ssi, uuid isa UUID ? uuid : UUID (uuid), environment_path, manifest, store, progress_callback, round (Int, 100 * (i - 1 ) / num_uuids))
284289 end
290+ took = round (time () - t0, sigdigits = 2 )
291+ progress_callback (" Loaded all packages into cache in $(took) s" , 100 )
285292end
286293
287294"""
@@ -300,6 +307,7 @@ function load_package_from_cache_into_store!(ssi::SymbolServerInstance, uuid::UU
300307 # further existence checks needed?
301308 cache_path = joinpath (ssi. store_path, get_cache_path (manifest, uuid)... )
302309 if isfile (cache_path)
310+ t0 = time ()
303311 progress_callback (" Loading $pe_name from cache..." , percentage)
304312 try
305313 package_data = open (cache_path) do io
@@ -315,6 +323,13 @@ function load_package_from_cache_into_store!(ssi::SymbolServerInstance, uuid::UU
315323 end
316324
317325 store[Symbol (pe_name)] = package_data. val
326+ took = round (time () - t0, sigdigits = 2 )
327+ msg = " Done loading $pe_name from cache..."
328+ if took > 0.01
329+ msg *= " (took $(took) s)"
330+ end
331+ progress_callback (msg, percentage)
332+ t0 = time ()
318333 for dep in deps (pe)
319334 load_package_from_cache_into_store! (ssi, packageuuid (dep), environment_path, manifest, store, progress_callback, percentage)
320335 end
0 commit comments