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