RGLab / flowWorkspace

flowWorkspace
GNU Affero General Public License v3.0
45 stars 21 forks source link

cache hash for pop vs id since it is expensive to compute for large tree #364

Closed mikejiang closed 3 years ago

mikejiang commented 3 years ago

This is before the patch

library(flowWorkspace)
gs = load_gs("~/Downloads/xxx_gating_set")
> length(gs_get_pop_paths(gs))
[1] 11026
> microbenchmark::microbenchmark(gs_pop_get_count_fast(gs[1:16])
+                                , times = 1)
Unit: seconds
                            expr      min       lq     mean   median       uq      max neval
 gs_pop_get_count_fast(gs[1:16]) 63.65044 63.65044 63.65044 63.65044 63.65044 63.65044     1

After apply https://github.com/RGLab/cytolib/pull/48 and this PR

Unit: seconds
                            expr       min        lq      mean    median        uq       max neval
 gs_pop_get_count_fast(gs[1:16]) 0.3776194 0.3776194 0.3776194 0.3776194 0.3776194 0.3776194     1

again, it passes tests locally.

[ FAIL 0 | WARN 18 | SKIP 21 | PASS 1668 ]
gfinak commented 3 years ago

Really nice work, Mike!