Unified · Split
| @@ -3,6 +3,7 @@ use git_features::progress::Progress; · 2 unmodified lines | ||
| 3 | 3 | use git_hash::ObjectId; |
| 4 | 4 | use git_object::bstr::ByteVec; |
| 5 | 5 | use git_odb::{linked, pack, FindExt}; |
| 6 | +use std::time::Instant; | |
| 6 | 7 | use std::{ffi::OsStr, io, path::Path, str::FromStr, sync::Arc}; |
| 7 | 8 | |
| 8 | 9 | pub const PROGRESS_RANGE: std::ops::RangeInclusive<u8> = 1..=2; |
| @@ -94,9 +95,10 @@ pub fn create( · 85 unmodified lines | ||
| 94 | 95 | |
| 95 | 96 | let chunk_size = 200; |
| 96 | 97 | progress.init(Some(3), git_features::progress::steps()); |
| 97 | − let mut count_progress = progress.add_child("counting"); | |
| 98 | − count_progress.init(None, git_features::progress::count("objects")); | |
| 98 | + let start = Instant::now(); | |
| 99 | 99 | let counts = { |
| 100 | + let mut count_progress = progress.add_child("counting"); | |
| 101 | + count_progress.init(None, git_features::progress::count("objects")); | |
| 100 | 102 | let counts_iter = pack::data::output::count_objects_iter( |
| 101 | 103 | Arc::clone(&db), |
| 102 | 104 | pack::cache::lru::StaticLinkedList::<64>::default, |
| @@ -117,8 +119,10 @@ pub fn create( · 14 unmodified lines | ||
| 117 | 119 | count_progress.inc_by(c.len()); |
| 118 | 120 | counts.extend(c.into_iter()); |
| 119 | 121 | } |
| 122 | + count_progress.show_throughput(start); | |
| 120 | 123 | counts |
| 121 | 124 | }; |
| 125 | + | |
| 122 | 126 | progress.inc(); |
| 123 | 127 | let num_objects = counts.len(); |
| 124 | 128 | let entries = pack::data::output::objects_to_entries_iter( |