Skip to content

refactor: pretty printing combinator for lists/tuples - #668

Merged
christoph-dfinity merged 7 commits into
nextfrom
christoph/sep-enclose-combinator
Aug 11, 2025
Merged

refactor: pretty printing combinator for lists/tuples#668
christoph-dfinity merged 7 commits into
nextfrom
christoph/sep-enclose-combinator

Conversation

@christoph-dfinity

Copy link
Copy Markdown
Contributor

Gets rid of the dodgy is_empty function that performed full traversals of documents to tell if they were empty.

Fixes #667

@christoph-dfinity
christoph-dfinity requested a review from a team as a code owner August 4, 2025 08:17
@github-actions

github-actions Bot commented Aug 4, 2025

Copy link
Copy Markdown
Name Max Mem (Kb) Encode Decode
blob 4_224 4_207_112 ($\textcolor{red}{0.00\%}$) 2_119_022 ($\textcolor{red}{0.00\%}$)
btreemap 75_456 4_290_588_958 ($\textcolor{red}{0.00\%}$) 15_185_828_516 ($\textcolor{red}{0.00\%}$)
nns 192 1_580_661 ($\textcolor{green}{-0.00\%}$) 3_226_561 ($\textcolor{red}{0.23\%}$)
nns_list_proposal 1_088 6_541_851 ($\textcolor{green}{-0.18\%}$) 46_648_099 ($\textcolor{green}{-0.07\%}$)
option_list 128 7_529_286 ($\textcolor{green}{-0.00\%}$) 24_840_141 ($\textcolor{green}{-0.33\%}$)
text 6_336 4_203_601 ($\textcolor{red}{0.00\%}$) 7_877_306 ($\textcolor{red}{0.00\%}$)
variant_list 128 7_524_789 ($\textcolor{red}{0.01\%}$) 23_264_809 ($\textcolor{red}{0.32\%}$)
vec_int16 16_704 123_692_906 ($\textcolor{red}{0.00\%}$) 952_128_418 ($\textcolor{red}{0.00\%}$)
  • Parser cost: 14_609_449 ($\textcolor{red}{0.00\%}$)
  • Extra args: 2_475_134 ($\textcolor{green}{-0.00\%}$)
Click to see raw report
---------------------------------------------------

Benchmark: blob
  total:
    instructions: 6.33 M (0.00%) (change within noise threshold)
    heap_increase: 66 pages (no change)
    stable_memory_increase: 0 pages (no change)

  1. Encoding (scope):
    calls: 1 (no change)
    instructions: 4.21 M (0.00%) (change within noise threshold)
    heap_increase: 66 pages (no change)
    stable_memory_increase: 0 pages (no change)

  2. Decoding (scope):
    calls: 1 (no change)
    instructions: 2.12 M (0.00%) (change within noise threshold)
    heap_increase: 0 pages (no change)
    stable_memory_increase: 0 pages (no change)

---------------------------------------------------

Benchmark: text
  total:
    instructions: 12.08 M (0.00%) (change within noise threshold)
    heap_increase: 99 pages (no change)
    stable_memory_increase: 0 pages (no change)

  1. Encoding (scope):
    calls: 1 (no change)
    instructions: 4.20 M (0.00%) (change within noise threshold)
    heap_increase: 66 pages (no change)
    stable_memory_increase: 0 pages (no change)

  2. Decoding (scope):
    calls: 1 (no change)
    instructions: 7.88 M (0.00%) (change within noise threshold)
    heap_increase: 33 pages (no change)
    stable_memory_increase: 0 pages (no change)

---------------------------------------------------

Benchmark: vec_int16
  total:
    instructions: 1.08 B (0.00%) (change within noise threshold)
    heap_increase: 261 pages (no change)
    stable_memory_increase: 0 pages (no change)

  1. Encoding (scope):
    calls: 1 (no change)
    instructions: 123.69 M (0.00%) (change within noise threshold)
    heap_increase: 261 pages (no change)
    stable_memory_increase: 0 pages (no change)

  2. Decoding (scope):
    calls: 1 (no change)
    instructions: 952.13 M (0.00%) (change within noise threshold)
    heap_increase: 0 pages (no change)
    stable_memory_increase: 0 pages (no change)

---------------------------------------------------

Benchmark: btreemap
  total:
    instructions: 19.48 B (0.00%) (change within noise threshold)
    heap_increase: 1179 pages (no change)
    stable_memory_increase: 0 pages (no change)

  1. Encoding (scope):
    calls: 1 (no change)
    instructions: 4.29 B (0.00%) (change within noise threshold)
    heap_increase: 159 pages (no change)
    stable_memory_increase: 0 pages (no change)

  2. Decoding (scope):
    calls: 1 (no change)
    instructions: 15.19 B (0.00%) (change within noise threshold)
    heap_increase: 1020 pages (no change)
    stable_memory_increase: 0 pages (no change)

---------------------------------------------------

Benchmark: option_list
  total:
    instructions: 32.37 M (-0.25%) (change within noise threshold)
    heap_increase: 2 pages (no change)
    stable_memory_increase: 0 pages (no change)

  1. Encoding (scope):
    calls: 1 (no change)
    instructions: 7.53 M (-0.00%) (change within noise threshold)
    heap_increase: 0 pages (no change)
    stable_memory_increase: 0 pages (no change)

  2. Decoding (scope):
    calls: 1 (no change)
    instructions: 24.84 M (-0.33%) (change within noise threshold)
    heap_increase: 2 pages (no change)
    stable_memory_increase: 0 pages (no change)

---------------------------------------------------

Benchmark: variant_list
  total:
    instructions: 30.79 M (0.24%) (change within noise threshold)
    heap_increase: 2 pages (no change)
    stable_memory_increase: 0 pages (no change)

  1. Encoding (scope):
    calls: 1 (no change)
    instructions: 7.52 M (0.01%) (change within noise threshold)
    heap_increase: 0 pages (no change)
    stable_memory_increase: 0 pages (no change)

  2. Decoding (scope):
    calls: 1 (no change)
    instructions: 23.26 M (0.32%) (change within noise threshold)
    heap_increase: 2 pages (no change)
    stable_memory_increase: 0 pages (no change)

---------------------------------------------------

Benchmark: nns
  total:
    instructions: 20.25 M (0.04%) (change within noise threshold)
    heap_increase: 3 pages (no change)
    stable_memory_increase: 0 pages (no change)

  0. Parsing (scope):
    calls: 1 (no change)
    instructions: 14.61 M (0.00%) (change within noise threshold)
    heap_increase: 3 pages (no change)
    stable_memory_increase: 0 pages (no change)

  1. Encoding (scope):
    calls: 1 (no change)
    instructions: 1.58 M (-0.00%) (change within noise threshold)
    heap_increase: 0 pages (no change)
    stable_memory_increase: 0 pages (no change)

  2. Decoding (scope):
    calls: 1 (no change)
    instructions: 3.23 M (0.23%) (change within noise threshold)
    heap_increase: 0 pages (no change)
    stable_memory_increase: 0 pages (no change)

---------------------------------------------------

Benchmark: nns_list_proposal
  total:
    instructions: 53.19 M (-0.09%) (change within noise threshold)
    heap_increase: 17 pages (no change)
    stable_memory_increase: 0 pages (no change)

  1. Encoding (scope):
    calls: 1 (no change)
    instructions: 6.54 M (-0.18%) (change within noise threshold)
    heap_increase: 3 pages (no change)
    stable_memory_increase: 0 pages (no change)

  2. Decoding (scope):
    calls: 1 (no change)
    instructions: 46.65 M (-0.07%) (change within noise threshold)
    heap_increase: 14 pages (no change)
    stable_memory_increase: 0 pages (no change)

---------------------------------------------------

Benchmark: extra_args
  total:
    instructions: 2.48 M (-0.00%) (change within noise threshold)
    heap_increase: 0 pages (no change)
    stable_memory_increase: 0 pages (no change)

---------------------------------------------------

Summary:
  instructions:
    status:   No significant changes 👍
    counts:   [total 9 | regressed 0 | improved 0 | new 0 | unchanged 9]
    change:   [max +74.39K | p75 +279 | median +94 | p25 -62 | min -81.98K]
    change %: [max +0.24% | p75 0.00% | median 0.00% | p25 -0.00% | min -0.25%]

  heap_increase:
    status:   No significant changes 👍
    counts:   [total 9 | regressed 0 | improved 0 | new 0 | unchanged 9]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

  stable_memory_increase:
    status:   No significant changes 👍
    counts:   [total 9 | regressed 0 | improved 0 | new 0 | unchanged 9]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

---------------------------------------------------
Successfully persisted results to canbench_results.yml

Gets rid of the dodgy is_empty function that traversed documents to
tell if they were empty
@christoph-dfinity
christoph-dfinity force-pushed the christoph/sep-enclose-combinator branch from 0101732 to c32d56c Compare August 4, 2025 09:05
christoph-dfinity added a commit that referenced this pull request Aug 4, 2025
…ments (#669)

Fixes #667

Alternative to #668, that doesn't constitute a breaking change
@christoph-dfinity
christoph-dfinity changed the base branch from master to next August 4, 2025 11:24
lastmjs pushed a commit to demergent-labs/candid that referenced this pull request Aug 7, 2025
…ments (dfinity#669)

Fixes dfinity#667

Alternative to dfinity#668, that doesn't constitute a breaking change
christoph-dfinity added a commit that referenced this pull request Aug 11, 2025
Looks like a recent bump of the Rust version on CI introduced new Clippy
lints that make CI fail on #668

This PR fixes those lint errors on the `next` branch.
Comment thread CHANGELOG.md Outdated
@christoph-dfinity
christoph-dfinity merged commit 3721557 into next Aug 11, 2025
6 checks passed
@christoph-dfinity
christoph-dfinity deleted the christoph/sep-enclose-combinator branch August 11, 2025 07:40
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.

Error: Broken function concat

2 participants