Skip to content

Commit

Permalink
Delete all custom perf-related code (#394)
Browse files Browse the repository at this point in the history
Deletes the perf_stats crate, and all of the custom perf-tracking code.
  • Loading branch information
macklin-10x authored Mar 14, 2024
1 parent e39af96 commit a0509ee
Show file tree
Hide file tree
Showing 34 changed files with 65 additions and 498 deletions.
12 changes: 0 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ members = [
"io_utils",
"kmer_lookup",
"load_feature_bc",
"perf_stats",
"stats_utils",
"stirling_numbers",
"string_utils",
Expand Down
1 change: 0 additions & 1 deletion enclone/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ equiv = { path = "../equiv" }
graph_simple = { path = "../graph_simple" }
io_utils = { path = "../io_utils" }
itertools.workspace = true
perf_stats = { path = "../perf_stats" }
petgraph = "0.6"
qd = { git = "https://github.com/Barandis/qd" }
rayon = "1"
Expand Down
2 changes: 0 additions & 2 deletions enclone/src/UNDOC_OPTIONS
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,6 @@ HAPS_DEBUG: turn on debug mode for the HAPS option

ROW_FILL_VERBOSE: special option for debugging

COMPE: COMP, plus enforce no unaccounted time (except up to 0.02 seconds)
UNACCOUNTED: show unaccounted time at each step
EVIL_EYE: print logging to facilitate diagnosis of mysterious hanging

TOOLTIP: add tooltip text to honeycomb plots
Expand Down
1 change: 0 additions & 1 deletion enclone/src/allele.rs
Original file line number Diff line number Diff line change
Expand Up @@ -595,5 +595,4 @@ pub fn sub_alts(
}
}
}
ctl.perf_stats(&t, "substituting alt alleles");
}
2 changes: 1 addition & 1 deletion enclone/src/enclone.test.tcr
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ set rootdir = `dirname $0`
enclone \
TCR=`cat $rootdir/../../enclone_core/src/enclone.testdata.tcr | tail -n +3 | grep -v '#' | \
tr -d ' ' | head --bytes=-1 | tr '\n' ';' | tr -s ';'` \
ANN COMP SHOW_BC MIN_DONORS=2 PLAIN NSILENT PRINT_FAILED_JOINS \
ANN SHOW_BC MIN_DONORS=2 PLAIN NSILENT PRINT_FAILED_JOINS \
PRE=/mnt/assembly/vdj/current15 $*
2 changes: 1 addition & 1 deletion enclone/src/enclone.test2
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ set rootdir = `dirname $0`
enclone \
BCR=`cat $rootdir/../../enclone_core/src/testdata.public.bcr.human | grep -v '#' | tr -d ' ' | grep -v '^$' | head --bytes=-1 | \
tr '\n' ';' | tr -s ';'` \
ANN COMP SHOW_BC MIN_DONORS=2 PLAIN NSILENT PRINT_FAILED_JOINS \
ANN SHOW_BC MIN_DONORS=2 PLAIN NSILENT PRINT_FAILED_JOINS \
PRE=/mnt/assembly/vdj/current15 $*
3 changes: 1 addition & 2 deletions enclone/src/join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ pub fn join_exacts(
if !ctl.silent {
println!("comparing {} simple clonotypes", info.len());
}
ctl.perf_stats(&timer1, "join setup");

let timer2 = Instant::now();

let joinf = |r: &mut (
Expand Down Expand Up @@ -601,7 +601,6 @@ pub fn join_exacts(

results.par_iter_mut().for_each(joinf);

ctl.perf_stats(&timer2, "in main part of join");
for r in &results {
for &j in &r.5 {
raw_joins.push((j.0 as i32, j.1 as i32));
Expand Down
2 changes: 1 addition & 1 deletion enclone/src/join2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,6 @@ pub fn finish_join(
let bad_rate = percent_ratio(bads, denom);
println!("whitelist contamination rate = {bad_rate:.2}%");
}
ctl.perf_stats(&timer3, "in tail of join");

eq
}
4 changes: 2 additions & 2 deletions enclone/src/misc1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use equiv::EquivRel;
use itertools::Itertools;
#[cfg(not(target_os = "windows"))]
use pager::Pager;
use perf_stats::elapsed;

use std::collections::HashMap;
use std::time::Instant;
use string_utils::stringme;
Expand Down Expand Up @@ -161,7 +161,7 @@ pub fn lookup_heavy_chain_reuse(
}
println!(
"\nused {:.2} seconds in heavy chain reuse calculation\n",
elapsed(&t)
t.elapsed().as_secs_f64()
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions enclone/src/misc2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ pub fn find_exact_subclonotypes(
groups.push((r, s));
r = s;
}
ctl.perf_stats(&t, "finding exact subclonotypes one");

let t = Instant::now();
let mut results = Vec::<(
usize,
Expand Down Expand Up @@ -423,7 +423,7 @@ pub fn find_exact_subclonotypes(
res.1.push(ExactClonotype { share, clones });
}
});
ctl.perf_stats(&t, "finding exact subclonotypes two");

let t = Instant::now();
let mut max_exact = 0;
for i in 0..results.len() {
Expand Down Expand Up @@ -519,7 +519,7 @@ pub fn find_exact_subclonotypes(
}
println!();
}
ctl.perf_stats(&t, "finding exact subclonotypes three");

exact_clonotypes
}

Expand Down
1 change: 0 additions & 1 deletion enclone_args/src/load_gex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ pub fn get_gex_info(ctl: &mut EncloneControl) -> Result<GexInfo, String> {
.collect()
})
.collect();
ctl.perf_stats(&t, "after load_gex");

// Answer.

Expand Down
2 changes: 0 additions & 2 deletions enclone_args/src/load_gex_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,6 @@ pub fn load_gex(
for (_, r) in &results {
ctl.pathlist.extend(r.f15.iter().cloned());
}
ctl.perf_stats(&t, "in load_gex main loop");

// Test for error.

Expand Down Expand Up @@ -631,6 +630,5 @@ pub fn load_gex(

// Done.

ctl.perf_stats(&t, "in load_gex tail");
Ok(())
}
6 changes: 0 additions & 6 deletions enclone_args/src/proc_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,6 @@ pub fn proc_args(ctl: &mut EncloneControl, args: &[String]) -> Result<(), String
"UMI_RATIO_FILT_MARK",
&mut ctl.clono_filt_opt_def.umi_ratio_filt_mark,
),
("UNACCOUNTED", &mut ctl.perf_opt.unaccounted),
("UTR_CON", &mut ctl.gen_opt.utr_con),
("VDUP", &mut ctl.clono_filt_opt.vdup),
("VIS_DUMP", &mut ctl.gen_opt.vis_dump),
Expand Down Expand Up @@ -646,9 +645,6 @@ pub fn proc_args(ctl: &mut EncloneControl, args: &[String]) -> Result<(), String

let set_nothing_simple = [
"CELLRANGER",
"COMP",
"COMPE",
"COMP2",
"DUMP_INTERNAL_IDS",
"EVIL_EYE",
"FORCE_EXTERNAL",
Expand Down Expand Up @@ -938,8 +934,6 @@ pub fn proc_args(ctl: &mut EncloneControl, args: &[String]) -> Result<(), String

// Record time.

ctl.perf_stats(&targs, "in main args loop");

// Do residual argument processing.

if ctl.gen_opt.internal_run && ctl.gen_opt.config.is_empty() {
Expand Down
2 changes: 1 addition & 1 deletion enclone_args/src/proc_args2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,6 @@ pub fn proc_args_tail(ctl: &mut EncloneControl, args: &[String]) -> Result<(), S
}
}
}
ctl.perf_stats(&tall, "in proc_args_tail");

Ok(())
}
7 changes: 3 additions & 4 deletions enclone_args/src/proc_args3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ pub fn proc_xcr(
other's structure.\n"
));
}
ctl.perf_stats(&t, "in proc_xcr 1");

let t = Instant::now();
for (id, d) in donor_groups.iter().enumerate() {
let origin_groups = if ctl.gen_opt.cellranger {
Expand Down Expand Up @@ -609,7 +609,6 @@ pub fn proc_xcr(
}
}
}
ctl.perf_stats(&t, "in proc_xcr 2");

// Get paths. This will need to change when cellranger switches to multi. This code is
// parallelized because this code can indirectly make many calls to path_exists, and the wall
Expand Down Expand Up @@ -641,7 +640,7 @@ pub fn proc_xcr(
}
}
}
ctl.perf_stats(&t, "in proc_xcr 3");

let t = Instant::now();
let spinlock: Arc<AtomicUsize> = Arc::new(AtomicUsize::new(0));
results.par_iter_mut().for_each(|res| {
Expand Down Expand Up @@ -688,7 +687,7 @@ pub fn proc_xcr(
ctl.origin_info.dataset_path.push(result.0);
ctl.origin_info.gex_path.push(result.1);
}
ctl.perf_stats(&t, "in proc_xcr 4");

Ok(())
}

Expand Down
4 changes: 2 additions & 2 deletions enclone_args/src/proc_args_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -778,12 +778,12 @@ pub fn check_lvars(ctl: &EncloneControl, gex_info: &GexInfo) -> Result<(), Strin
to_check.push(x.clone());
}
}
ctl.perf_stats(&t, "checking lvars top");

let t = Instant::now();
if !to_check.is_empty() {
check_gene_fb(ctl, gex_info, &to_check, "lead")?;
}
ctl.perf_stats(&t, "checking gene");

Ok(())
}

Expand Down
5 changes: 2 additions & 3 deletions enclone_args/src/proc_args_post.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,6 @@ pub fn proc_args_post(
.to_string(),
);
}
ctl.perf_stats(&t, "after main args loop 1");

// Process TCR, BCR and META.

Expand All @@ -515,7 +514,7 @@ pub fn proc_args_post(
.collect();
proc_meta_core(&lines, ctl)?;
}
ctl.perf_stats(&t, "in proc_meta");

if !xcrs.is_empty() {
let arg = &xcrs[xcrs.len() - 1];
proc_xcr(arg, gex, bc, have_gex, ctl)?;
Expand Down Expand Up @@ -669,7 +668,7 @@ pub fn proc_args_post(
ctl.clono_filt_opt_def.donor = true;
}
}
ctl.perf_stats(&t, "after main args loop 2");

proc_args_tail(ctl, args)?;

// Sort chains_to_align.
Expand Down
1 change: 0 additions & 1 deletion enclone_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ evalexpr = ">=7, <12"
io_utils = { path = "../io_utils" }
itertools.workspace = true
lazy_static = "1"
perf_stats = { path = "../perf_stats" }
qd = { git = "https://github.com/Barandis/qd" }
rayon = "1"
regex = { version = "1", default-features = false, features = ["std", "perf"] }
Expand Down
Loading

0 comments on commit a0509ee

Please sign in to comment.