Skip to content

feat: Add rangemap feature to ic_principal - #696

Merged
lwshang merged 2 commits into
masterfrom
spofford/feat-rangemap
Jan 9, 2026
Merged

feat: Add rangemap feature to ic_principal#696
lwshang merged 2 commits into
masterfrom
spofford/feat-rangemap

Conversation

@adamspofford-dfinity

Copy link
Copy Markdown
Contributor

We use rangemap in ic-agent for canister ranges. It has a feature to implement the required trait even if the upstream type doesn't, but it blocks implementing Debug and a couple other annoyances so it'd be nice for ic_principal to implement it directly.

@adamspofford-dfinity
adamspofford-dfinity requested a review from a team as a code ownerJanuary 9, 2026 17:43
@github-actions

github-actionsBot commented Jan 9, 2026

Copy link
Copy Markdown
NameMax Mem (Kb)EncodeDecode
blob4_2244_206_7062_121_260
btreemap75_4564_811_217_25115_215_316_878
nns1281_980_4775_495_863 ($\textcolor{red}{0.00\%}$)
nns_list_proposal1_0886_898_349 ($\textcolor{green}{-0.02\%}$)66_578_476 ($\textcolor{green}{-0.00\%}$)
option_list1288_196_54725_916_353
text6_3364_203_5587_877_247
variant_list1288_250_35624_320_598
vec_int1616_704123_692_9061_017_141_938
  • Parser cost: 17_015_122
  • Extra args: 3_237_822
Click to see raw report
---------------------------------------------------
Benchmark: blob
total:
instructions: 6.33 M (no change)
heap_increase: 66 pages (no change)
stable_memory_increase: 0 pages (no change)
1. Encoding (scope):
calls: 1 (no change)
instructions: 4.21 M (no change)
heap_increase: 66 pages (no change)
stable_memory_increase: 0 pages (no change)
2. Decoding (scope):
calls: 1 (no change)
instructions: 2.12 M (no change)
heap_increase: 0 pages (no change)
stable_memory_increase: 0 pages (no change)
---------------------------------------------------
Benchmark: btreemap
total:
instructions: 20.03 B (no change)
heap_increase: 1179 pages (no change)
stable_memory_increase: 0 pages (no change)
1. Encoding (scope):
calls: 1 (no change)
instructions: 4.81 B (no change)
heap_increase: 159 pages (no change)
stable_memory_increase: 0 pages (no change)
2. Decoding (scope):
calls: 1 (no change)
instructions: 15.22 B (no change)
heap_increase: 1020 pages (no change)
stable_memory_increase: 0 pages (no change)
---------------------------------------------------
Benchmark: extra_args
total:
instructions: 3.24 M (no change)
heap_increase: 0 pages (no change)
stable_memory_increase: 0 pages (no change)
---------------------------------------------------
Benchmark: nns
total:
instructions: 25.33 M (0.00%) (change within noise threshold)
heap_increase: 2 pages (no change)
stable_memory_increase: 0 pages (no change)
0. Parsing (scope):
calls: 1 (no change)
instructions: 17.02 M (no change)
heap_increase: 2 pages (no change)
stable_memory_increase: 0 pages (no change)
1. Encoding (scope):
calls: 1 (no change)
instructions: 1.98 M (no change)
heap_increase: 0 pages (no change)
stable_memory_increase: 0 pages (no change)
2. Decoding (scope):
calls: 1 (no change)
instructions: 5.50 M (0.00%) (change within noise threshold)
heap_increase: 0 pages (no change)
stable_memory_increase: 0 pages (no change)
---------------------------------------------------
Benchmark: nns_list_proposal
total:
instructions: 73.48 M (-0.00%) (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.90 M (-0.02%) (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: 66.58 M (-0.00%) (change within noise threshold)
heap_increase: 14 pages (no change)
stable_memory_increase: 0 pages (no change)
---------------------------------------------------
Benchmark: option_list
total:
instructions: 34.12 M (no change)
heap_increase: 2 pages (no change)
stable_memory_increase: 0 pages (no change)
1. Encoding (scope):
calls: 1 (no change)
instructions: 8.20 M (no change)
heap_increase: 0 pages (no change)
stable_memory_increase: 0 pages (no change)
2. Decoding (scope):
calls: 1 (no change)
instructions: 25.92 M (no change)
heap_increase: 2 pages (no change)
stable_memory_increase: 0 pages (no change)
---------------------------------------------------
Benchmark: text
total:
instructions: 12.08 M (no change)
heap_increase: 99 pages (no change)
stable_memory_increase: 0 pages (no change)
1. Encoding (scope):
calls: 1 (no change)
instructions: 4.20 M (no change)
heap_increase: 66 pages (no change)
stable_memory_increase: 0 pages (no change)
2. Decoding (scope):
calls: 1 (no change)
instructions: 7.88 M (no change)
heap_increase: 33 pages (no change)
stable_memory_increase: 0 pages (no change)
---------------------------------------------------
Benchmark: variant_list
total:
instructions: 32.57 M (no change)
heap_increase: 2 pages (no change)
stable_memory_increase: 0 pages (no change)
1. Encoding (scope):
calls: 1 (no change)
instructions: 8.25 M (no change)
heap_increase: 0 pages (no change)
stable_memory_increase: 0 pages (no change)
2. Decoding (scope):
calls: 1 (no change)
instructions: 24.32 M (no change)
heap_increase: 2 pages (no change)
stable_memory_increase: 0 pages (no change)
---------------------------------------------------
Benchmark: vec_int16
total:
instructions: 1.14 B (no change)
heap_increase: 261 pages (no change)
stable_memory_increase: 0 pages (no change)
1. Encoding (scope):
calls: 1 (no change)
instructions: 123.69 M (no change)
heap_increase: 261 pages (no change)
stable_memory_increase: 0 pages (no change)
2. Decoding (scope):
calls: 1 (no change)
instructions: 1.02 B (no change)
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 +264 | p75 0 | median 0 | p25 0 | min -1.53K]
change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min -0.00%]
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

@lwshang
lwshang merged commit 4e9d3b8 into masterJan 9, 2026
11 checks passed
@lwshang
lwshang deleted the spofford/feat-rangemap branch January 9, 2026 17:55
Sign up for freeto 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.

2 participants

@adamspofford-dfinity@lwshang