Skip to content

Drop the Flow parser's comment-moving AST mapper classes - #9267

Open
cknitt wants to merge 1 commit into
remove-dead-code-reanalyzefrom
remove-flow-ast-mapper
Open

cknitt wants to merge 1 commit into
remove-dead-code-reanalyzefrom
remove-flow-ast-mapper

Conversation

@cknitt

@cknitt cknitt commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Stacked on #9173. Makes the compiler start with much less work by dropping the Flow parser's comment-moving AST mapper classes.

Why

The Flow parser (compiler/flow_parser) only parses %raw code, but OCaml initializes all its modules when the compiler starts. Its Flow_ast_mapper.mapper class (336 methods) and the two Comment_attachment classes that inherit it are created then, method tables and a closure per method, in every compiler process.

Measured by linking the Flow parser into an otherwise empty program:

This PR's benchmark (see the comment below) shows the effect on whole compilations:

  • Allocated words: −24.2% in total, up to −78% for small runtime files (Primitive_list.resi: 568,603 → 122,397).
  • Instructions: −4.6% in total, up to −44% for small files (Stdlib_Math.resi: 44.1M → 24.6M).

The saving is a fixed amount per compiler process, so small files gain the most; parse/Napkinscript.res gains 2–3%.

What changes

Flow uses the mapper to move trailing comments off nodes it has already built. ReScript never reads trailing comments. It only reads the leading comment of a %raw literal, which the parser collects without the mapper, and which tests/tests/src/raw_pure_test.res covers.

  • The removers in Comment_attachment now return the node unchanged.
  • What they keep is the consumption of comments, which decides where later comments attach.
  • Flow_ast_mapper and both classes are removed, along with the ~kind arguments the parsers passed for them.

Without the mapper, most fields of the Flow AST are only written; #9208 handles that for make dead-code.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Kbf3gLDo8mBJKpNE25WAwT

Flow moves trailing comments off nodes it has already built with an AST
mapper class (Flow_ast_mapper, 336 methods) and two subclasses in
Comment_attachment. OCaml creates classes when their module is
initialized, so every compiler process built their method tables:
about 206,000 of the compiler's ~275,000 startup words, although
ReScript only parses %raw code with the Flow parser and never reads
trailing comments (only the leading comment of a %raw literal, which
the parser collects without the mapper).

The removers now return the node unchanged; what they kept is the
consumption of comments, which decides where later comments attach.
Flow_ast_mapper and both classes go. The Flow parser's startup
allocation, measured by linking it into an otherwise empty program,
drops from 227,172 to 20,669 words.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kbf3gLDo8mBJKpNE25WAwT
Signed-off-by: Christoph Knittel <ck@cca.io>
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

Changelog

💅 Polish

  • Start the compiler with less work: the Flow parser for %raw code no longer creates AST mapper classes at startup.

Semantic Diff

1 commit · Full page

Drop the Flow parser's comment-moving AST mapper classes

defd652 · cknitt + Claude · Nov 08, 2026, 18:03 UTC

Flow moves trailing comments off nodes it has already built with an AST mapper class (Flow_ast_mapper, 336 methods) and two subclasses in Comment_attachment. OCaml creates classes when their module is initialized, so every compiler process built their method tables: about 206,000 of the compiler's ~275,000 startup words, although ReScript only parses %raw code with the Flow parser and never reads trailing comments (only the leading comment of a %raw literal, which the parser collects without the mapper).

The removers now return the node unchanged; what they kept is the consumption of comments, which decides where later comments attach. Flow_ast_mapper and both classes go. The Flow parser's startup allocation, measured by linking it into an otherwise empty program, drops from 227,172 to 20,669 words.

@cknitt

cknitt commented Nov 8, 2026

Copy link
Copy Markdown
Member Author

@codex review

@cknitt
cknitt marked this pull request as ready for review November 8, 2026 18:14
@cknitt
cknitt requested a review from cristianoc November 8, 2026 18:14
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-08T18:15:27.164218Z defd652 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: defd652ed2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

🎉 Compiler benchmarks

Allocated words

In total: 456,745,704 → 346,086,726 (-24.23%).

🎉 Improvement: 253 benchmarks allocate more than 1% less.

Benchmark Base Head Change
packages/@rescript/runtime/Primitive_list.resi 568,603 122,397 -78.47%
packages/@rescript/runtime/Primitive_float_extern.res 570,171 123,965 -78.26%
packages/@rescript/runtime/Stdlib_Blob.res 570,301 124,095 -78.24%
packages/@rescript/runtime/Stdlib_File.res 572,145 125,939 -77.99%
packages/@rescript/runtime/Primitive_promise.res 573,711 127,505 -77.78%
packages/@rescript/runtime/Primitive_int_extern.res 574,485 128,279 -77.67%
packages/@rescript/runtime/Primitive_string_extern.res 574,834 128,628 -77.62%
packages/@rescript/runtime/Stdlib_Iterable.resi 575,050 128,844 -77.59%
packages/@rescript/runtime/Stdlib_AsyncIterable.resi 575,197 128,991 -77.57%
packages/@rescript/runtime/Obj.res 575,757 129,551 -77.50%
247 more changes
Benchmark Base Head Change
packages/@rescript/runtime/Stdlib_Iterable.res 575,826 129,620 -77.49%
packages/@rescript/runtime/Stdlib_AsyncIterable.res 575,903 129,697 -77.48%
packages/@rescript/runtime/Primitive_exceptions.resi 577,068 130,862 -77.32%
packages/@rescript/runtime/Primitive_hash.resi 579,535 133,329 -76.99%
packages/@rescript/runtime/Primitive_dict.res 579,634 133,428 -76.98%
packages/@rescript/runtime/Primitive_module.resi 579,956 133,750 -76.94%
packages/@rescript/runtime/RescriptTools.res 580,978 134,772 -76.80%
packages/@rescript/runtime/Stdlib_TaggedTemplate.resi 583,383 137,177 -76.49%
packages/@rescript/runtime/Stdlib_ArrayBuffer.res 584,993 138,787 -76.28%
packages/@rescript/runtime/Stdlib_ArrayBuffer.resi 587,811 141,605 -75.91%
packages/@rescript/runtime/RescriptTools_ExtractCodeBlocks.res 588,882 142,676 -75.77%
packages/@rescript/runtime/Stdlib_Lazy.resi 589,385 143,179 -75.71%
packages/@rescript/runtime/Primitive_array_extern.res 591,428 145,222 -75.45%
packages/@rescript/runtime/Primitive_object_extern.res 591,700 145,494 -75.41%
packages/@rescript/runtime/Stdlib_TaggedTemplate.res 593,165 146,949 -75.23%
packages/@rescript/runtime/Stdlib_Intl_Segments.res 593,547 147,341 -75.18%
packages/@rescript/runtime/Stdlib_Bool.resi 593,656 147,450 -75.16%
packages/@rescript/runtime/Primitive_object.resi 594,238 148,032 -75.09%
packages/@rescript/runtime/Dom_storage2.res 596,916 150,710 -74.75%
packages/@rescript/runtime/Jsx.res 599,126 152,920 -74.48%
packages/@rescript/runtime/Primitive_option.resi 599,479 153,273 -74.43%
packages/@rescript/runtime/Stdlib_JsExn.resi 599,959 153,753 -74.37%
packages/@rescript/runtime/Stdlib_WeakSet.res 600,096 153,890 -74.36%
packages/@rescript/runtime/Stdlib_Type.resi 612,825 166,619 -72.81%
packages/@rescript/runtime/Stdlib_WeakMap.res 613,006 166,800 -72.79%
packages/@rescript/runtime/Stdlib_Temporal_Now.res 620,226 174,020 -71.94%
packages/@rescript/runtime/Stdlib_Global.res 621,968 175,762 -71.74%
packages/@rescript/runtime/Stdlib_Symbol.res 624,112 177,906 -71.49%
packages/@rescript/runtime/Stdlib_Bool.res 624,953 178,747 -71.40%
packages/@rescript/runtime/Primitive_bool.res 626,328 180,122 -71.24%
packages/@rescript/runtime/Primitive_float.res 626,558 180,352 -71.22%
packages/@rescript/belt/src/Belt_Int.resi 626,956 180,750 -71.17%
packages/@rescript/belt/src/Belt_Float.resi 628,433 182,227 -71.00%
packages/@rescript/runtime/Stdlib_IterableIterator.resi 628,565 182,359 -70.99%
packages/@rescript/runtime/Stdlib_Intl_Common.res 630,940 184,734 -70.72%
packages/@rescript/runtime/Stdlib_Ordering.res 631,082 184,876 -70.70%
packages/@rescript/runtime/Stdlib_Intl_Segmenter.res 632,005 185,799 -70.60%
packages/@rescript/runtime/Stdlib_Global.resi 633,350 187,144 -70.45%
packages/@rescript/runtime/Stdlib_Symbol.resi 637,427 191,221 -70.00%
packages/@rescript/runtime/Stdlib_Intl_NumberFormat_Grouping.res 637,553 191,347 -69.99%
packages/@rescript/runtime/Stdlib_Iterator.resi 638,457 192,251 -69.89%
packages/@rescript/runtime/Stdlib_AsyncIterableIterator.resi 639,334 193,128 -69.79%
packages/@rescript/runtime/Stdlib_Generator.resi 639,683 193,477 -69.75%
packages/@rescript/runtime/Primitive_string.res 640,562 194,356 -69.66%
packages/@rescript/belt/src/Belt_internalBucketsType.resi 643,690 197,484 -69.32%
packages/@rescript/belt/src/Belt_Float.res 644,181 197,975 -69.27%
packages/@rescript/belt/src/Belt_Int.res 644,616 198,410 -69.22%
packages/@rescript/runtime/Stdlib_Pair.res 645,557 199,351 -69.12%
packages/@rescript/runtime/Stdlib_RegExp.res 646,072 199,866 -69.06%
packages/@rescript/runtime/Stdlib_AsyncGenerator.resi 646,151 199,945 -69.06%
packages/@rescript/runtime/Dom_storage.res 647,049 200,843 -68.96%
packages/@rescript/belt/src/Belt_MutableStack.resi 647,724 201,518 -68.89%
packages/@rescript/belt/src/Belt_SortArrayString.resi 647,808 201,602 -68.88%
packages/@rescript/runtime/Stdlib_Intl_ListFormat.res 647,902 201,696 -68.87%
packages/@rescript/belt/src/Belt_SortArrayInt.resi 647,932 201,726 -68.87%
packages/@rescript/runtime/Stdlib_Intl.res 651,308 205,102 -68.51%
packages/@rescript/runtime/Primitive_int.res 653,260 207,054 -68.30%
packages/@rescript/belt/src/Belt_HashSetString.resi 653,640 207,434 -68.26%
packages/@rescript/belt/src/Belt_HashSetInt.resi 653,758 207,552 -68.25%
packages/@rescript/belt/src/Belt_Range.resi 654,495 208,289 -68.18%
packages/@rescript/runtime/Stdlib_JsExn.res 655,783 209,577 -68.04%
packages/@rescript/runtime/Stdlib_Intl_Collator.res 657,527 211,321 -67.86%
packages/@rescript/runtime/Stdlib_Intl_RelativeTimeFormat.res 658,770 212,564 -67.73%
packages/@rescript/runtime/Primitive_bigint.res 658,840 212,634 -67.73%
packages/@rescript/runtime/Stdlib_AsyncIterator.resi 659,234 213,028 -67.69%
packages/@rescript/runtime/Stdlib_JsError.resi 663,355 217,149 -67.27%
packages/@rescript/runtime/Stdlib_IterableIterator.res 664,170 217,904 -67.19%
packages/@rescript/runtime/Stdlib_BigInt.resi 664,577 218,371 -67.14%
packages/@rescript/belt/src/Belt.res 665,608 219,402 -67.04%
packages/@rescript/runtime/Stdlib_RegExp.resi 666,363 220,157 -66.96%
packages/@rescript/runtime/Stdlib_Float.resi 672,483 226,277 -66.35%
packages/@rescript/runtime/Stdlib_Intl_Locale.res 677,020 230,814 -65.91%
packages/@rescript/runtime/Primitive_array.res 678,231 232,025 -65.79%
packages/@rescript/belt/src/Belt_internalSetBuckets.resi 678,624 232,418 -65.75%
packages/@rescript/runtime/Stdlib_Nullable.resi 681,296 235,090 -65.49%
packages/@rescript/runtime/Stdlib_Intl_PluralRules.res 681,753 235,547 -65.45%
packages/@rescript/runtime/Stdlib_Type.res 682,072 235,866 -65.42%
packages/@rescript/runtime/Stdlib_Int.resi 684,399 238,193 -65.20%
packages/@rescript/runtime/Primitive_exceptions.res 684,967 238,761 -65.14%
packages/@rescript/runtime/Stdlib_Null.resi 685,772 239,566 -65.07%
packages/@rescript/belt/src/Belt_MutableQueue.resi 686,888 240,682 -64.96%
packages/@rescript/runtime/Stdlib_Generator.res 687,515 241,309 -64.90%
packages/@rescript/runtime/Stdlib_BigInt.res 689,939 243,733 -64.67%
packages/@rescript/runtime/Primitive_list.res 690,212 244,006 -64.65%
packages/@rescript/runtime/Stdlib_Map.res 690,700 244,494 -64.60%
packages/@rescript/belt/src/Belt_HashMapString.resi 693,818 247,612 -64.31%
packages/@rescript/belt/src/Belt_HashMapInt.resi 693,939 247,733 -64.30%
packages/@rescript/runtime/Stdlib_Set.res 696,081 249,875 -64.10%
packages/@rescript/runtime/Stdlib_Map.resi 698,664 252,458 -63.87%
packages/@rescript/runtime/Stdlib_Temporal.res 700,943 254,737 -63.66%
packages/@rescript/runtime/Stdlib_AsyncGenerator.res 701,829 255,623 -63.58%
packages/@rescript/runtime/Stdlib_Float.res 703,168 256,942 -63.46%
packages/@rescript/belt/src/Belt_HashSet.resi 704,337 258,131 -63.35%
packages/@rescript/runtime/Stdlib_Set.resi 709,660 263,454 -62.88%
packages/@rescript/runtime/Stdlib_Lazy.res 709,792 263,586 -62.86%
packages/@rescript/belt/src/Belt_internalBuckets.resi 711,924 265,718 -62.68%
packages/@rescript/runtime/Stdlib_JsError.res 716,231 270,025 -62.30%
packages/@rescript/runtime/Stdlib_JSON.resi 716,459 270,253 -62.28%
packages/@rescript/runtime/Stdlib_DataView.res 716,922 270,716 -62.24%
packages/@rescript/runtime/Stdlib_Option.resi 718,214 272,008 -62.13%
packages/@rescript/runtime/Stdlib_IteratorObject.resi 718,303 272,097 -62.12%
packages/@rescript/runtime/Stdlib_AsyncIterableIterator.res 719,209 272,943 -62.05%
packages/@rescript/runtime/Primitive_js_extern.res 719,423 273,217 -62.02%
packages/@rescript/runtime/Pervasives.res 719,723 273,517 -62.00%
packages/@rescript/runtime/Stdlib_Iterator.res 722,017 275,781 -61.80%
packages/@rescript/runtime/Stdlib_Dict.resi 722,035 275,829 -61.80%
packages/@rescript/belt/src/Belt_Option.resi 723,538 277,332 -61.67%
packages/@rescript/runtime/Stdlib_Object.res 723,690 277,484 -61.66%
packages/@rescript/belt/src/Belt_Result.resi 725,280 279,074 -61.52%
packages/@rescript/belt/src/Belt_SortArray.resi 733,874 287,668 -60.80%
packages/@rescript/belt/src/Belt_SetString.resi 739,633 293,427 -60.33%
packages/@rescript/belt/src/Belt_Id.resi 739,677 293,471 -60.32%
packages/@rescript/belt/src/Belt_SetInt.resi 739,767 293,561 -60.32%
packages/@rescript/runtime/Stdlib_IteratorObject.res 743,371 297,165 -60.02%
packages/@rescript/belt/src/Belt_MutableSetString.resi 744,897 298,691 -59.90%
packages/@rescript/belt/src/Belt_MutableSetInt.resi 745,019 298,813 -59.89%
packages/@rescript/runtime/Stdlib_DataView.resi 748,306 302,100 -59.63%
packages/@rescript/runtime/Stdlib_Temporal_PlainMonthDay.res 748,326 302,120 -59.63%
packages/@rescript/runtime/RescriptTools_Docgen.resi 758,590 312,384 -58.82%
packages/@rescript/runtime/RescriptTools_Docgen.res 768,969 322,763 -58.03%
packages/@rescript/belt/src/Belt_Id.res 774,964 328,758 -57.58%
packages/@rescript/belt/src/Belt_internalBucketsType.res 776,584 330,378 -57.46%
packages/@rescript/belt/src/Belt_Range.res 779,046 332,840 -57.28%
packages/@rescript/belt/src/Belt_HashMap.resi 780,938 334,732 -57.14%
packages/@rescript/runtime/Stdlib_Result.resi 782,519 336,313 -57.02%
packages/@rescript/runtime/Stdlib_JSON.res 783,784 337,578 -56.93%
packages/@rescript/runtime/Stdlib_Temporal_Instant.res 787,946 341,740 -56.63%
packages/@rescript/runtime/Stdlib_AsyncIterator.res 791,747 345,511 -56.36%
packages/@rescript/runtime/Primitive_option.res 793,033 346,827 -56.27%
packages/@rescript/belt/src/Belt_MutableMapString.resi 798,231 352,025 -55.90%
packages/@rescript/belt/src/Belt_MutableMapInt.resi 798,356 352,150 -55.89%
packages/@rescript/runtime/Stdlib_Temporal_PlainTime.res 800,386 354,180 -55.75%
packages/@rescript/runtime/Stdlib_Math.resi 810,478 364,272 -55.05%
packages/@rescript/runtime/Stdlib_Dict.res 811,481 365,165 -55.00%
packages/@rescript/runtime/Stdlib_Math.res 820,739 374,533 -54.37%
packages/@rescript/runtime/Stdlib_Int8Array.res 822,291 376,085 -54.26%
packages/@rescript/runtime/Stdlib_Uint8Array.res 822,306 376,100 -54.26%
packages/@rescript/runtime/Stdlib_Float32Array.res 822,404 376,198 -54.26%
packages/@rescript/runtime/Stdlib_Float64Array.res 822,404 376,198 -54.26%
packages/@rescript/runtime/Stdlib_Int16Array.res 822,438 376,232 -54.25%
packages/@rescript/runtime/Stdlib_Int32Array.res 822,438 376,232 -54.25%
packages/@rescript/runtime/Stdlib_Uint16Array.res 822,445 376,239 -54.25%
packages/@rescript/runtime/Stdlib_Uint32Array.res 822,445 376,239 -54.25%
packages/@rescript/runtime/Stdlib_BigInt64Array.res 822,465 376,259 -54.25%
packages/@rescript/runtime/Stdlib_BigUint64Array.res 822,538 376,332 -54.25%
packages/@rescript/runtime/Stdlib_Uint8ClampedArray.res 822,823 376,617 -54.23%
packages/@rescript/runtime/Stdlib_Nullable.res 827,799 381,593 -53.90%
packages/@rescript/runtime/Stdlib_Null.res 829,759 383,553 -53.78%
packages/@rescript/runtime/Primitive_module.res 834,197 387,991 -53.49%
packages/@rescript/belt/src/Belt_internalAVLset.resi 848,865 402,659 -52.57%
packages/@rescript/runtime/Stdlib_Promise.resi 853,671 407,465 -52.27%
packages/@rescript/runtime/Stdlib_Promise.res 854,047 407,841 -52.25%
packages/@rescript/runtime/Stdlib_Temporal_Common.res 854,286 408,080 -52.23%
packages/@rescript/runtime/Stdlib_Temporal_Duration.res 855,673 409,467 -52.15%
packages/@rescript/runtime/Stdlib_Console.res 863,489 417,283 -51.67%
packages/@rescript/runtime/Stdlib_Temporal_PlainYearMonth.res 864,681 418,475 -51.60%
packages/@rescript/runtime/Stdlib_Intl_DateTimeFormat.res 874,270 428,064 -51.04%
packages/@rescript/belt/src/Belt_MapString.resi 877,119 430,913 -50.87%
packages/@rescript/belt/src/Belt_MapInt.resi 877,167 430,961 -50.87%
packages/@rescript/belt/src/Belt_Option.res 884,693 438,487 -50.44%
packages/@rescript/runtime/Stdlib_Temporal_PlainDate.res 884,824 438,618 -50.43%
packages/@rescript/belt/src/Belt_MutableSet.resi 884,882 438,676 -50.43%
packages/@rescript/belt/src/Belt_MutableMap.resi 885,291 439,085 -50.40%
packages/@rescript/runtime/Stdlib_Intl_NumberFormat.res 890,653 444,447 -50.10%
packages/@rescript/belt/src/Belt_SetDict.resi 891,846 445,640 -50.03%
packages/@rescript/belt/src/Belt_MutableStack.res 892,123 445,919 -50.02%
packages/@rescript/runtime/Stdlib_List.resi 895,831 449,625 -49.81%
packages/@rescript/runtime/Stdlib_Console.resi 900,289 454,083 -49.56%
packages/@rescript/runtime/Stdlib_Temporal_PlainDateTime.res 919,409 473,203 -48.53%
packages/@rescript/belt/src/Belt_Result.res 919,637 473,429 -48.52%
packages/@rescript/belt/src/Belt_Set.resi 925,808 479,602 -48.20%
packages/@rescript/runtime/Stdlib_Int.res 951,931 505,727 -46.87%
packages/@rescript/belt/src/Belt_internalAVLtree.resi 957,898 511,690 -46.58%
packages/@rescript/runtime/Stdlib_String.resi 982,388 536,182 -45.42%
packages/@rescript/runtime/Stdlib_String.res 1,008,933 562,727 -44.23%
packages/@rescript/belt/src/Belt_MapDict.resi 1,010,938 564,741 -44.14%
packages/@rescript/runtime/Stdlib_Date.res 1,056,047 609,841 -42.25%
packages/@rescript/runtime/Stdlib_Temporal_ZonedDateTime.res 1,059,346 613,140 -42.12%
packages/@rescript/belt/src/Belt_Map.resi 1,075,417 629,213 -41.49%
packages/@rescript/runtime/Stdlib_Date.resi 1,102,346 656,140 -40.48%
packages/@rescript/belt/src/Belt_Array.resi 1,150,643 704,437 -38.78%
parse/RedBlackTreeNoComments.res 593,119 370,016 -37.62%
parse/RedBlackTree.res 600,833 377,730 -37.13%
packages/@rescript/runtime/Stdlib_Array.resi 1,224,657 778,451 -36.44%
packages/@rescript/belt/src/Belt_internalSetBuckets.res 1,238,065 791,857 -36.04%
packages/@rescript/belt/src/Belt_internalSetInt.res 1,266,336 820,130 -35.24%
packages/@rescript/belt/src/Belt_internalSetString.res 1,267,521 821,317 -35.20%
packages/@rescript/belt/src/Belt_List.resi 1,269,564 823,358 -35.15%
packages/@rescript/runtime/Stdlib_TypedArray.res 1,273,796 827,590 -35.03%
packages/@rescript/runtime/Stdlib_Option.res 1,287,816 841,583 -34.65%
packages/@rescript/belt/src/Belt_MutableQueue.res 1,326,985 880,779 -33.63%
packages/@rescript/belt/src/Belt_HashSetInt.res 1,410,905 964,697 -31.63%
packages/@rescript/belt/src/Belt_HashSetString.res 1,411,216 965,012 -31.62%
packages/@rescript/belt/src/Belt_Set.res 1,417,614 971,512 -31.47%
packages/@rescript/runtime/Stdlib.res 1,462,928 1,016,722 -30.50%
packages/@rescript/runtime/Primitive_hash.res 1,500,646 1,054,338 -29.74%
packages/@rescript/belt/src/Belt_internalBuckets.res 1,554,799 1,108,527 -28.70%
packages/@rescript/belt/src/Belt_Map.res 1,559,456 1,113,256 -28.61%
packages/@rescript/belt/src/Belt_HashSet.res 1,571,939 1,125,729 -28.39%
packages/@rescript/runtime/JsxEvent.res 1,591,868 1,146,223 -28.00%
format/RedBlackTreeNoComments.res 813,781 590,678 -27.42%
packages/@rescript/belt/src/Belt_HashMapInt.res 1,669,717 1,223,511 -26.72%
packages/@rescript/belt/src/Belt_HashMapString.res 1,670,421 1,224,217 -26.71%
packages/@rescript/runtime/Dom.res 1,694,962 1,248,756 -26.33%
packages/@rescript/runtime/Primitive_object.res 1,719,164 1,272,912 -25.96%
format/RedBlackTree.res 867,090 643,987 -25.73%
packages/@rescript/belt/src/Belt_MutableMapInt.res 1,771,978 1,325,776 -25.18%
packages/@rescript/belt/src/Belt_MutableMapString.res 1,772,252 1,326,050 -25.18%
packages/@rescript/belt/src/Belt_MapInt.res 1,814,857 1,368,653 -24.59%
packages/@rescript/belt/src/Belt_MapString.res 1,815,394 1,369,188 -24.58%
packages/@rescript/belt/src/Belt_HashMap.res 1,846,433 1,400,227 -24.17%
packages/@rescript/runtime/Stdlib_Array.res 1,863,123 1,416,917 -23.95%
packages/@rescript/belt/src/Belt_SetInt.res 1,893,380 1,447,170 -23.57%
packages/@rescript/belt/src/Belt_SetString.res 1,894,104 1,447,894 -23.56%
packages/@rescript/runtime/Stdlib_Result.res 1,901,921 1,455,711 -23.46%
packages/@rescript/belt/src/Belt_SortArrayInt.res 1,927,697 1,481,495 -23.15%
packages/@rescript/belt/src/Belt_SortArrayString.res 1,929,485 1,483,285 -23.13%
packages/@rescript/belt/src/Belt_MutableMap.res 1,940,225 1,494,019 -23.00%
packages/@rescript/belt/src/Belt_SortArray.res 2,043,578 1,597,370 -21.83%
packages/@rescript/belt/src/Belt_internalMapInt.res 2,089,204 1,642,998 -21.36%
packages/@rescript/belt/src/Belt_internalMapString.res 2,091,041 1,644,835 -21.34%
packages/@rescript/belt/src/Belt_SetDict.res 2,119,786 1,673,587 -21.05%
packages/@rescript/belt/src/Belt_MutableSetInt.res 2,311,300 1,865,096 -19.31%
packages/@rescript/belt/src/Belt_MutableSetString.res 2,312,536 1,866,289 -19.30%
packages/@rescript/belt/src/Belt_MapDict.res 2,357,557 1,911,339 -18.93%
packages/@rescript/runtime/JsxDOMStyle.res 2,513,455 2,067,249 -17.75%
packages/@rescript/belt/src/Belt_MutableSet.res 2,607,729 2,161,529 -17.11%
packages/@rescript/belt/src/Belt_Array.res 2,840,659 2,394,453 -15.71%
packages/@rescript/runtime/JsxDOM.res 3,309,263 2,863,057 -13.48%
packages/@rescript/runtime/Stdlib_List.res 3,394,151 2,947,937 -13.15%
packages/@rescript/belt/src/Belt_internalAVLset.res 3,655,715 3,209,545 -12.20%
packages/@rescript/belt/src/Belt_List.res 3,947,458 3,501,252 -11.30%
parse/HeroGraphic.res 2,092,023 1,868,915 -10.66%
packages/@rescript/belt/src/Belt_internalAVLtree.res 4,424,082 3,977,876 -10.09%
format/HeroGraphic.res 3,299,378 3,076,275 -6.76%
stress/ListLiteral.res 3,783,427 3,560,324 -5.90%
stress/InlineChain.res 3,974,189 3,751,086 -5.61%
parse/Napkinscript.res 10,953,901 10,730,798 -2.04%
stress/NestedClosures.res 11,785,048 11,561,945 -1.89%
stress/PolyVariantSwitch.res 14,563,295 14,340,192 -1.53%
stress/RefsInLoop.res 17,383,327 17,160,224 -1.28%
format/Napkinscript.res 17,890,749 17,667,646 -1.25%
stress/ObjectFields.res 21,038,310 20,815,207 -1.06%
stress/TypeAliasChain.res 22,449,140 22,226,037 -0.99%
stress/Record.res 26,503,971 26,280,868 -0.84%
stress/IntSwitch.res 30,069,736 29,846,633 -0.74%
stress/LetRec.res 35,104,114 34,881,011 -0.64%

Instructions

In total: 10,228,138,742 → 9,755,245,397 (-4.62%).

🎉 Improvement: 30 benchmarks execute more than 1% fewer instructions.

Benchmark Base Head Change
packages/@rescript/runtime/Stdlib_Math.resi 44,127,842 24,577,612 -44.30%
packages/@rescript/runtime/Stdlib_Temporal_PlainDate.res 46,946,843 27,393,657 -41.65%
packages/@rescript/runtime/Stdlib_List.resi 47,616,494 28,059,408 -41.07%
packages/@rescript/runtime/Stdlib_Temporal_PlainDateTime.res 48,385,871 28,840,170 -40.40%
parse/RedBlackTreeNoComments.res 25,948,649 16,174,169 -37.67%
packages/@rescript/runtime/Stdlib_String.resi 52,332,649 32,785,435 -37.35%
parse/RedBlackTree.res 26,355,391 16,581,568 -37.08%
packages/@rescript/runtime/Stdlib_Temporal_ZonedDateTime.res 54,141,690 34,571,407 -36.15%
packages/@rescript/runtime/Stdlib_Date.resi 57,174,194 37,625,215 -34.19%
packages/@rescript/belt/src/Belt_Array.resi 57,589,871 38,049,946 -33.93%
23 more changes
Benchmark Base Head Change
packages/@rescript/belt/src/Belt_List.resi 62,539,367 43,016,908 -31.22%
packages/@rescript/runtime/Stdlib_Array.resi 63,164,142 43,608,089 -30.96%
packages/@rescript/runtime/Stdlib_TypedArray.res 64,245,593 44,674,902 -30.46%
format/RedBlackTreeNoComments.res 35,479,860 25,705,202 -27.55%
format/RedBlackTree.res 35,824,272 26,049,623 -27.28%
packages/@rescript/runtime/JsxDOMStyle.res 119,823,265 100,936,883 -15.76%
packages/@rescript/belt/src/Belt_List.res 145,503,282 125,995,470 -13.41%
packages/@rescript/runtime/JsxDOM.res 142,783,415 123,849,216 -13.26%
parse/HeroGraphic.res 81,830,799 72,045,637 -11.96%
packages/@rescript/belt/src/Belt_internalAVLtree.res 166,070,564 146,491,717 -11.79%
stress/ListLiteral.res 146,221,526 136,460,484 -6.68%
stress/InlineChain.res 150,923,386 141,838,118 -6.02%
format/HeroGraphic.res 222,943,779 213,169,149 -4.38%
parse/Napkinscript.res 345,147,287 335,369,408 -2.83%
stress/RefsInLoop.res 411,342,716 401,546,032 -2.38%
stress/TypeAliasChain.res 536,760,669 526,987,435 -1.82%
stress/NestedClosures.res 558,633,615 548,775,030 -1.76%
format/Napkinscript.res 614,636,864 604,862,762 -1.59%
stress/PolyVariantSwitch.res 645,537,238 636,430,313 -1.41%
stress/ObjectFields.res 961,161,901 951,427,624 -1.01%
stress/IntSwitch.res 1,742,056,653 1,726,648,507 -0.88%
stress/LetRec.res 1,431,070,187 1,418,885,456 -0.85%
stress/Record.res 1,083,818,868 1,075,812,845 -0.74%

Pull request defd652 compared with base 98faffc in this run.

@pkg-pr-new

pkg-pr-new Bot commented Nov 8, 2026

Copy link
Copy Markdown

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript@9267

@rescript/belt

npm i https://pkg.pr.new/@rescript/belt@9267

@rescript/darwin-arm64

npm i https://pkg.pr.new/@rescript/darwin-arm64@9267

@rescript/linux-arm64

npm i https://pkg.pr.new/@rescript/linux-arm64@9267

@rescript/linux-x64

npm i https://pkg.pr.new/@rescript/linux-x64@9267

@rescript/runtime

npm i https://pkg.pr.new/@rescript/runtime@9267

@rescript/win32-x64

npm i https://pkg.pr.new/@rescript/win32-x64@9267

commit: defd652

This branch has not been deployed

No deployments
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