Skip to content

Conversation

@ilbertt
Copy link
Contributor

@ilbertt ilbertt commented Jul 2, 2025

Overview
Adds support for line comments (// ...) as doc comments in these places:

  • above services:
    // This is a valid doc comment for the service
    service : {
      greet : (text) -> (text);
    }
    
  • above actor methods:
    service : {
      // This is a valid doc comment for greet
      greet : (text) -> (text);
    }
    
  • above type declarations:
    // This is a valid doc comment for type A
    type A = record {
      my_field : text;
    };
    
  • above record and variant fields:
    type A = record {
      // This is a valid doc comment for my_field
      my_field : text;
    };
    
    type B = record {
      // This is a valid doc comment for nat element
      nat;
      text;
    }
    
    type C = variant {
      // This is a valid doc comment for my_variant_field
      my_variant_field : nat;
    };
    

Closes #631.
Closes #621.
Closes #620.
Closes #619.

Considerations
This doesn't break anything, as comments are invisible to the parser.

@ilbertt ilbertt requested a review from a team as a code owner July 2, 2025 09:08
@github-actions
Copy link

github-actions bot commented Jul 2, 2025

Name Max Mem (Kb) Encode Decode
blob 4_224 4_206_559 2_121_065
btreemap 75_456 4_261_360_630 15_241_691_028
nns 192 ($\textcolor{red}{50.00\%}$) 1_966_599 ($\textcolor{green}{-0.01\%}$) 5_474_107 ($\textcolor{red}{0.09\%}$)
nns_list_proposal 1_088 6_814_402 ($\textcolor{red}{0.00\%}$) 67_872_454 ($\textcolor{green}{-0.00\%}$)
option_list 128 7_475_104 25_776_931
text 6_336 4_203_506 7_877_229
variant_list 128 7_531_305 ($\textcolor{red}{0.00\%}$) 24_342_804 ($\textcolor{red}{0.35\%}$)
vec_int16 16_704 123_693_002 1_069_570_587
  • Parser cost: 15_211_320 ($\textcolor{red}{1.40\%}$)
  • Extra args: 3_146_843
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: 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: vec_int16
  total:
    instructions: 1.19 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.07 B (no change)
    heap_increase: 0 pages (no change)
    stable_memory_increase: 0 pages (no change)

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

Benchmark: btreemap
  total:
    instructions: 19.50 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.26 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.24 B (no change)
    heap_increase: 1020 pages (no change)
    stable_memory_increase: 0 pages (no change)

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

Benchmark: option_list
  total:
    instructions: 33.25 M (no change)
    heap_increase: 2 pages (no change)
    stable_memory_increase: 0 pages (no change)

  1. Encoding (scope):
    calls: 1 (no change)
    instructions: 7.48 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.78 M (no change)
    heap_increase: 2 pages (no change)
    stable_memory_increase: 0 pages (no change)

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

Benchmark: variant_list
  total:
    instructions: 31.88 M (0.27%) (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.34 M (0.35%) (change within noise threshold)
    heap_increase: 2 pages (no change)
    stable_memory_increase: 0 pages (no change)

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

Benchmark: nns
  total:
    instructions: 23.49 M (0.92%) (change within noise threshold)
    heap_increase: 3 pages (regressed by 50.00%)
    stable_memory_increase: 0 pages (no change)

  0. Parsing (scope):
    calls: 1 (no change)
    instructions: 15.21 M (1.40%) (change within noise threshold)
    heap_increase: 3 pages (regressed by 50.00%)
    stable_memory_increase: 0 pages (no change)

  1. Encoding (scope):
    calls: 1 (no change)
    instructions: 1.97 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: 5.47 M (0.09%) (change within noise threshold)
    heap_increase: 0 pages (no change)
    stable_memory_increase: 0 pages (no change)

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

Benchmark: nns_list_proposal
  total:
    instructions: 74.69 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.81 M (0.00%) (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: 67.87 M (-0.00%) (change within noise threshold)
    heap_increase: 14 pages (no change)
    stable_memory_increase: 0 pages (no change)

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

Benchmark: extra_args
  total:
    instructions: 3.15 M (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 +214.65K | p75 +124 | median 0 | p25 0 | min 0]
    change %: [max +0.92% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

  heap_increase:
    status:   Regressions detected 🔴
    counts:   [total 9 | regressed 1 | improved 0 | new 0 | unchanged 8]
    change:   [max +1 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max +50.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%]

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

Only significant changes:
| status | name            | calls |    ins |  ins Δ% | HI |   HI Δ% | SMI |  SMI Δ% |
|--------|-----------------|-------|--------|---------|----|---------|-----|---------|
|   +    | nns::0. Parsing |     1 | 15.21M |  +1.40% |  3 | +50.00% |   0 |   0.00% |
|   +    | nns             |       | 23.49M |  +0.92% |  3 | +50.00% |   0 |   0.00% |

ins = instructions, HI = heap_increase, SMI = stable_memory_increase, Δ% = percent change

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

Copy link
Contributor

@christoph-dfinity christoph-dfinity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just some minor nits!

@ilbertt ilbertt requested a review from christoph-dfinity July 2, 2025 09:41
Copy link
Contributor

@christoph-dfinity christoph-dfinity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@ilbertt ilbertt merged commit 3fb57ba into master Jul 2, 2025
11 checks passed
@ilbertt ilbertt deleted the luca/support-doc-comments branch July 2, 2025 09:47
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.

2 participants