Skip to content

hash map#258

Merged
ms609 merged 8 commits intomainfrom
posit-9006
Mar 13, 2026
Merged

hash map#258
ms609 merged 8 commits intomainfrom
posit-9006

Conversation

@ms609
Copy link
Copy Markdown
Owner

@ms609 ms609 commented Mar 13, 2026

Faster match lookup (?)

ms609 added 6 commits March 13, 2026 09:45
_init.R: do.call(bench::mark, args) evaluates expressions before
passing them, so bench stored the evaluated result (e.g. a phylo
tree) instead of the call. Restored direct ... passthrough.

_compare_results.R: Use deparse1() instead of as.character(unlist())
for expression extraction (the latter decomposes call objects into
components). Also iterate by index to guard against NA names, and
use res$change instead of outer-scope percentage_change.
_init.R: do.call(bench::mark, args) evaluates expressions before
passing them, so bench stored the evaluated result (e.g. a phylo
tree) instead of the call. Restored direct ... passthrough.

_compare_results.R: Use deparse1() instead of as.character(unlist())
for expression extraction (the latter decomposes call objects into
components). Also iterate by index to guard against NA names, and
use res$change instead of outer-scope percentage_change.
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 13, 2026

⚠️ This benchmark result is outdated. See the latest comment below.

Performance benchmark results

Call Status Change Time (ms)
as.Splits(bigTrees) ⚪ NSD -0.77% 22.4 →
22.7, 22.5
as.Splits(someTrees) ⚪ NSD 2.14% 11.6 →
11.4, 11.1
Consensus(forest1k.888, check = FALSE) ⚪ NSD 0.85% 99.8 →
99.8, 98.1
Consensus(forest201.80, check = FALSE) ⚪ NSD 0.14% 4.11 →
4.1, 4.11
Consensus(forest21.260, 0.5, FALSE) ⚪ NSD -1.16% 1.23 →
1.25, 1.23
Consensus(forest21.260) ⚪ NSD -0.36% 1.25 →
1.26, 1.24
Consensus(forestMaj, 0.5, FALSE) ⚪ NSD 0% 2.99 →
3, 2.97
DropTip(tr2000, 5) ⚪ NSD 0.74% 17.7 →
17.6, 17.5
DropTip(tr80, 5) ⚪ NSD -0.32% 0.107 →
0.107, 0.107
DropTip(unlen2k, 5) ⚪ NSD 1.69% 0.297 →
0.294, 0.291
DropTip(unlen80, 5) ⚪ NSD 0.22% 0.0405 →
0.0404, 0.0403
lapply(bigSplits, as.phylo) 🟣 ~same 2.11% 30 →
29.3, 29.4
lapply(someSplits, as.phylo) 🟣 ~same 4.73% 14.4 →
13.5, 13.7
PathLengths(tr2000, full = TRUE) ⚪ NSD -0.2% 16.8 →
16.7, 17.1
PathLengths(tr80, full = TRUE) ⚪ NSD -10.25% 0.0387 →
0.0419, 0.044
PathLengths(tr80Unif, full = TRUE) ⚪ NSD -5.79% 0.0411 →
0.0439, 0.0423
RootTree(tr2000, 5) ⚪ NSD -0.18% 0.394 →
0.395, 0.396
RootTree(tr80, c("t3", "t36")) ⚪ NSD 0.33% 0.0711 →
0.071, 0.0707
RootTree(tr80, "t3") ⚪ NSD -1.68% 0.0496 →
0.0504, 0.0504
RootTree(tr80, "t30") ⚪ NSD -1.72% 0.0496 →
0.0503, 0.0505
RootTree(unlen2k, 5) ⚪ NSD 0.14% 0.33 →
0.33, 0.328
RootTree(unlen80, c("t3", "t36")) ⚪ NSD -0.09% 0.0654 →
0.0657, 0.0651
RootTree(unlen80, "t3") ⚪ NSD -1.55% 0.0428 →
0.0434, 0.0435
RootTree(unlen80, "t30") ⚪ NSD -0.88% 0.0434 →
0.044, 0.0437
TreeDist::RobinsonFoulds(forest201.80) ⚪ NSD 0.85% 16.2 →
15.9, 16.1
TreeDist::RobinsonFoulds(forest21.888) ⚪ NSD -0.31% 3.29 →
3.28, 3.32
TreeTools:::path_lengths(tr80$edge, tr80$edge.length, FALSE) ⚪ NSD -1.42% 0.102 →
0.106, 0.1
TreeTools:::postorder_order(bal40) ⚪ NSD 0.51% 0.00176 →
0.00174, 0.00177
TreeTools:::postorder_order(bal40k) ⚪ NSD 1.53% 0.436 →
0.43, 0.429
TreeTools:::postorder_order(dbal40) ⚪ NSD -2.25% 0.00182 →
0.00183, 0.00188
TreeTools:::postorder_order(dbal40k) ⚪ NSD -9.11% 2.19 →
2.39, 2.39
TreeTools:::postorder_order(dpec40) ⚪ NSD -17.94% 0.00263 →
0.00306, 0.00312
TreeTools:::postorder_order(dpec40k) 🟣 ~same -5.93% 3410 →
3620, 3610
TreeTools:::postorder_order(drnd80) ⚪ NSD -25.85% 0.00411 →
0.00511, 0.00523
TreeTools:::postorder_order(nbal40) ⚪ NSD -2.74% 0.00216 →
0.00216, 0.00225
TreeTools:::postorder_order(nbal40k) 🟠 Slower 🙁 -10.37% 2.19 →
2.42, 2.41
TreeTools:::postorder_order(npec40) ⚪ NSD -15.78% 0.00292 →
0.00335, 0.0034
TreeTools:::postorder_order(npec40k) 🟠 Slower 🙁 -6.1% 3430 →
3640, 3630
TreeTools:::postorder_order(nrnd80) ⚪ NSD -23.35% 0.00464 →
0.00567, 0.00575
TreeTools:::postorder_order(pec40) ⚪ NSD -1.16% 0.00173 →
0.00171, 0.00181
TreeTools:::postorder_order(pec40k) ⚪ NSD 2.36% 0.437 →
0.425, 0.427
TreeTools:::postorder_order(rnd80) ⚪ NSD 1.8% 0.00221 →
0.0021, 0.00223

Base automatically changed from batch-as-splits to main March 13, 2026 11:26
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 13, 2026

⚠️ This benchmark result is outdated. See the latest comment below.

Performance benchmark results

Call Status Change Time (ms)
as.Splits(bigTrees) 🟠 Slower 🙁 -14.87% 21.8 →
23.7, 25.6
as.Splits(someTrees) ⚪ NSD 1.93% 11.7 →
11.6, 11.4
Consensus(forest1k.888, check = FALSE) ⚪ NSD -0.4% 102 →
100, 105
Consensus(forest201.80, check = FALSE) ⚪ NSD -1.54% 4.12 →
4.14, 4.25
Consensus(forest21.260, 0.5, FALSE) ⚪ NSD -0.66% 1.25 →
1.25, 1.26
Consensus(forest21.260) ⚪ NSD -0.3% 1.27 →
1.27, 1.28
Consensus(forestMaj, 0.5, FALSE) ⚪ NSD -1.27% 3.03 →
3.01, 3.1
DropTip(tr2000, 5) ⚪ NSD -2.75% 17.2 →
17.9, 17.3
DropTip(tr80, 5) ⚪ NSD 1.39% 0.107 →
0.106, 0.106
DropTip(unlen2k, 5) ⚪ NSD -31.46% 0.216 →
0.211, 0.295
DropTip(unlen80, 5) ⚪ NSD 0.22% 0.0408 →
0.0403, 0.041
lapply(bigSplits, as.phylo) ⚪ NSD -0.2% 29.6 →
29.5, 29.7
lapply(someSplits, as.phylo) ⚪ NSD 1.33% 14.1 →
14.1, 13.9
PathLengths(tr2000, full = TRUE) ⚪ NSD 0.51% 16.7 →
16.8, 16.4
PathLengths(tr80, full = TRUE) ⚪ NSD -3.04% 0.0451 →
0.0494, 0.0419
PathLengths(tr80Unif, full = TRUE) ⚪ NSD 0.86% 0.048 →
0.0501, 0.0432
RootTree(tr2000, 5) ⚪ NSD 1.73% 0.395 →
0.397, 0.377
RootTree(tr80, c("t3", "t36")) ⚪ NSD 1.43% 0.0724 →
0.0709, 0.0717
RootTree(tr80, "t3") ⚪ NSD 0.51% 0.0506 →
0.0503, 0.0503
RootTree(tr80, "t30") ⚪ NSD 0.61% 0.051 →
0.0506, 0.0507
RootTree(unlen2k, 5) ⚪ NSD 0.28% 0.333 →
0.33, 0.334
RootTree(unlen80, c("t3", "t36")) ⚪ NSD 0.02% 0.0662 →
0.0661, 0.0662
RootTree(unlen80, "t3") ⚪ NSD 0.2% 0.0439 →
0.0433, 0.0442
RootTree(unlen80, "t30") ⚪ NSD 0.13% 0.0443 →
0.0437, 0.0446
TreeDist::RobinsonFoulds(forest201.80) ⚪ NSD -0.98% 16.1 →
16.1, 16.4
TreeDist::RobinsonFoulds(forest21.888) ⚪ NSD -1.18% 3.28 →
3.3, 3.33
TreeTools:::path_lengths(tr80$edge, tr80$edge.length, FALSE) ⚪ NSD 1.65% 0.109 →
0.109, 0.106
TreeTools:::postorder_order(bal40) ⚪ NSD -0.51% 0.00174 →
0.00174, 0.00175
TreeTools:::postorder_order(bal40k) ⚪ NSD -0.32% 0.434 →
0.438, 0.434
TreeTools:::postorder_order(dbal40) ⚪ NSD -0.54% 0.00184 →
0.00186, 0.00185
TreeTools:::postorder_order(dbal40k) 🟠 Slower 🙁 -10% 2.19 →
2.4, 2.41
TreeTools:::postorder_order(dpec40) ⚪ NSD -16.74% 0.00264 →
0.00308, 0.00309
TreeTools:::postorder_order(dpec40k) 🟠 Slower 🙁 -6.39% 3400 →
3610, 3610
TreeTools:::postorder_order(drnd80) ⚪ NSD -27.31% 0.00407 →
0.00518, 0.00518
TreeTools:::postorder_order(nbal40) ⚪ NSD -1.33% 0.00219 →
0.0022, 0.00222
TreeTools:::postorder_order(nbal40k) ⚪ NSD -10.77% 2.21 →
2.82, 2.44
TreeTools:::postorder_order(npec40) ⚪ NSD -15.86% 0.00291 →
0.00339, 0.00337
TreeTools:::postorder_order(npec40k) 🟣 ~same -5.81% 3440 →
3650, 3630
TreeTools:::postorder_order(nrnd80) ⚪ NSD -22.01% 0.00465 →
0.00568, 0.00566
TreeTools:::postorder_order(pec40) ⚪ NSD 1.09% 0.00174 →
0.00173, 0.00171
TreeTools:::postorder_order(pec40k) ⚪ NSD 0% 0.432 →
0.433, 0.431
TreeTools:::postorder_order(rnd80) ⚪ NSD 0% 0.00219 →
0.0022, 0.00218

@github-actions
Copy link
Copy Markdown

Performance benchmark results

Call Status Change Time (ms)
as.Splits(bigTrees) ⚪ NSD -6.12% 21.9 →
23.7, 22.1
as.Splits(someTrees) ⚪ NSD -3.58% 11.2 →
11.8, 11.1
Consensus(forest1k.888, check = FALSE) ⚪ NSD 0.85% 98.2 →
97.9, 97
Consensus(forest201.80, check = FALSE) ⚪ NSD -2.6% 3.99 →
4.16, 4.05
Consensus(forest21.260, 0.5, FALSE) ⚪ NSD -0.75% 1.22 →
1.23, 1.24
Consensus(forest21.260) ⚪ NSD -1.11% 1.24 →
1.25, 1.25
Consensus(forestMaj, 0.5, FALSE) ⚪ NSD -2.13% 2.93 →
2.98, 2.99
DropTip(tr2000, 5) ⚪ NSD 0.1% 17.3 →
17.7, 16.9
DropTip(tr80, 5) ⚪ NSD 0.78% 0.107 →
0.107, 0.104
DropTip(unlen2k, 5) ⚪ NSD 25.19% 0.292 →
0.217, 0.22
DropTip(unlen80, 5) ⚪ NSD 2.82% 0.0419 →
0.041, 0.0405
lapply(bigSplits, as.phylo) ⚪ NSD -1.72% 29.1 →
29.9, 29.3
lapply(someSplits, as.phylo) ⚪ NSD -0.67% 13.9 →
14, 13.8
PathLengths(tr2000, full = TRUE) ⚪ NSD -1.72% 16.3 →
17.1, 16
PathLengths(tr80, full = TRUE) ⚪ NSD -1.65% 0.0402 →
0.0418, 0.04
PathLengths(tr80Unif, full = TRUE) ⚪ NSD -1.53% 0.042 →
0.044, 0.041
RootTree(tr2000, 5) ⚪ NSD 0.26% 0.386 →
0.392, 0.375
RootTree(tr80, c("t3", "t36")) ⚪ NSD -1.5% 0.0695 →
0.0703, 0.0708
RootTree(tr80, "t3") ⚪ NSD 0.5% 0.0504 →
0.05, 0.0502
RootTree(tr80, "t30") ⚪ NSD 0.52% 0.0504 →
0.0503, 0.0499
RootTree(unlen2k, 5) ⚪ NSD -1.53% 0.324 →
0.326, 0.33
RootTree(unlen80, c("t3", "t36")) ⚪ NSD -1.54% 0.0639 →
0.0646, 0.0651
RootTree(unlen80, "t3") ⚪ NSD -1.16% 0.043 →
0.0432, 0.0438
RootTree(unlen80, "t30") ⚪ NSD -1.04% 0.0434 →
0.0435, 0.0442
TreeDist::RobinsonFoulds(forest201.80) ⚪ NSD -0.37% 16.5 →
16.8, 16.3
TreeDist::RobinsonFoulds(forest21.888) ⚪ NSD -1.43% 3.27 →
3.32, 3.32
TreeTools:::path_lengths(tr80$edge, tr80$edge.length, FALSE) ⚪ NSD -1.8% 0.103 →
0.106, 0.104
TreeTools:::postorder_order(bal40) ⚪ NSD 0.57% 0.00174 →
0.00174, 0.00172
TreeTools:::postorder_order(bal40k) ⚪ NSD 0.96% 0.432 →
0.428, 0.428
TreeTools:::postorder_order(dbal40) ⚪ NSD -3.3% 0.00181 →
0.00187, 0.00187
TreeTools:::postorder_order(dbal40k) 🟠 Slower 🙁 -9.61% 2.17 →
2.38, 2.38
TreeTools:::postorder_order(dpec40) ⚪ NSD -18.92% 0.0026 →
0.00309, 0.00309
TreeTools:::postorder_order(dpec40k) 🟠 Slower 🙁 -7.18% 3370 →
3620, 3610
TreeTools:::postorder_order(drnd80) ⚪ NSD -26.33% 0.00407 →
0.00517, 0.0051
TreeTools:::postorder_order(nbal40) ⚪ NSD -1.87% 0.00219 →
0.00222, 0.00225
TreeTools:::postorder_order(nbal40k) 🟠 Slower 🙁 -10.77% 2.17 →
2.42, 2.39
TreeTools:::postorder_order(npec40) ⚪ NSD -17.71% 0.00289 →
0.00338, 0.00342
TreeTools:::postorder_order(npec40k) 🟠 Slower 🙁 -7.12% 3390 →
3630, 3630
TreeTools:::postorder_order(nrnd80) ⚪ NSD -22.73% 0.00463 →
0.00569, 0.00566
TreeTools:::postorder_order(pec40) ⚪ NSD -0.58% 0.00173 →
0.00174, 0.00174
TreeTools:::postorder_order(pec40k) ⚪ NSD 0.73% 0.43 →
0.428, 0.426
TreeTools:::postorder_order(rnd80) ⚪ NSD 1.37% 0.00219 →
0.00221, 0.0021

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.37%. Comparing base (0d7feda) to head (e5977aa).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #258      +/-   ##
==========================================
+ Coverage   96.33%   96.37%   +0.03%     
==========================================
  Files          77       77              
  Lines        5758     5761       +3     
==========================================
+ Hits         5547     5552       +5     
+ Misses        211      209       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ms609 ms609 merged commit a221fac into main Mar 13, 2026
35 of 36 checks passed
@ms609 ms609 deleted the posit-9006 branch March 13, 2026 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant