Skip to content

Feat/flow inline#620

Draft
nielstron wants to merge 3 commits intodevfrom
feat/flow-inline
Draft

Feat/flow inline#620
nielstron wants to merge 3 commits intodevfrom
feat/flow-inline

Conversation

@nielstron
Copy link
Copy Markdown
Contributor

minimal variant of #617

@github-actions
Copy link
Copy Markdown

⚠️ Binary Size Changes Detected

Binary Size Comparison Report
Loading baseline measurements...
Measuring current binary sizes and execution costs...
Measuring assert_sum...
  O0: 54788 bytes
    Evaluating test case: valid_sum
      CPU: 44,041,759 | MEM: 238,774
  O1: 3530 bytes
    Evaluating test case: valid_sum
      CPU: 19,545,759 | MEM: 85,674
  O2: 3524 bytes
    Evaluating test case: valid_sum
      CPU: 19,506,516 | MEM: 85,442
  O3: 1292 bytes
    Evaluating test case: valid_sum
      CPU: 17,346,516 | MEM: 71,942
Measuring liquidity_pool...
  O0: 151504 bytes
  O1: 47450 bytes
  O2: 47184 bytes
  O3: 18284 bytes
Measuring marketplace...
  O0: 123792 bytes
  O1: 26144 bytes
  O2: 26048 bytes
  O3: 4672 bytes
Measuring gift...
  O0: 57260 bytes
    Evaluating test case: valid_withdrawal
      CPU: 51,540,498 | MEM: 263,535
  O1: 5350 bytes
    Evaluating test case: valid_withdrawal
      CPU: 28,468,498 | MEM: 119,335
  O2: 5344 bytes
    Evaluating test case: valid_withdrawal
      CPU: 28,390,012 | MEM: 118,871
  O3: 1608 bytes
    Evaluating test case: valid_withdrawal
      CPU: 25,542,012 | MEM: 101,071
Measuring wrapped_token...
  O0: 64542 bytes
  O1: 9280 bytes
  O2: 8992 bytes
  O3: 3806 bytes
Measuring micropayments...
  O0: 88364 bytes
  O1: 20820 bytes
  O2: 20746 bytes
  O3: 7096 bytes
Measuring pool_validator...
  O0: 63204 bytes
    Evaluating test case: swap_a_for_b
      CPU: 144,496,682 | MEM: 550,657
    Evaluating test case: swap_b_for_a
      CPU: 144,496,682 | MEM: 550,657
    Evaluating test case: deposit
      CPU: 145,521,818 | MEM: 540,207
    Evaluating test case: withdraw
      CPU: 146,018,200 | MEM: 542,509
  O1: 11202 bytes
    Evaluating test case: swap_a_for_b
      CPU: 128,848,682 | MEM: 452,857
    Evaluating test case: swap_b_for_a
      CPU: 128,848,682 | MEM: 452,857
    Evaluating test case: deposit
      CPU: 130,257,818 | MEM: 444,807
    Evaluating test case: withdraw
      CPU: 130,754,200 | MEM: 447,109
  O2: 10756 bytes
    Evaluating test case: swap_a_for_b
      CPU: 127,479,243 | MEM: 444,891
    Evaluating test case: swap_b_for_a
      CPU: 127,479,243 | MEM: 444,891
    Evaluating test case: deposit
      CPU: 129,379,332 | MEM: 439,343
    Evaluating test case: withdraw
      CPU: 129,843,714 | MEM: 441,445
  O3: 4676 bytes
    Evaluating test case: swap_a_for_b
      CPU: 120,219,315 | MEM: 409,107
    Evaluating test case: swap_b_for_a
      CPU: 120,219,315 | MEM: 409,107
    Evaluating test case: deposit
      CPU: 122,119,404 | MEM: 403,559
    Evaluating test case: withdraw
      CPU: 122,583,786 | MEM: 405,661
Measuring lp_minting_policy...
  O0: 56424 bytes
    Evaluating test case: mint_one_nft
      CPU: 54,068,929 | MEM: 267,073
    Evaluating test case: mint_two_nfts
      CPU: 71,341,257 | MEM: 317,848
  O1: 2768 bytes
    Evaluating test case: mint_one_nft
      CPU: 28,932,929 | MEM: 109,973
    Evaluating test case: mint_two_nfts
      CPU: 47,197,257 | MEM: 166,948
  O2: 2764 bytes
    Evaluating test case: mint_one_nft
      CPU: 28,893,686 | MEM: 109,741
    Evaluating test case: mint_two_nfts
      CPU: 47,118,771 | MEM: 166,484
  O3: 1328 bytes
    Evaluating test case: mint_one_nft
      CPU: 27,501,686 | MEM: 101,041
    Evaluating test case: mint_two_nfts
      CPU: 45,726,771 | MEM: 157,784
Measuring nft_marketplace_validator...
  O0: 57338 bytes
    Evaluating test case: buy_one
      CPU: 64,707,409 | MEM: 308,335
    Evaluating test case: cancel_one
      CPU: 55,914,847 | MEM: 288,419
  O1: 6078 bytes
    Evaluating test case: buy_one
      CPU: 42,803,409 | MEM: 171,435
    Evaluating test case: cancel_one
      CPU: 33,610,847 | MEM: 149,019
  O2: 5840 bytes
    Evaluating test case: buy_one
      CPU: 42,308,923 | MEM: 168,371
    Evaluating test case: cancel_one
      CPU: 33,123,604 | MEM: 145,987
  O3: 2484 bytes
    Evaluating test case: buy_one
      CPU: 39,061,941 | MEM: 150,475
    Evaluating test case: cancel_one
      CPU: 29,588,622 | MEM: 126,291
Measuring nft_minting_policy...
  O0: 56470 bytes
    Evaluating test case: valid_mint
      CPU: 54,443,157 | MEM: 276,246
  O1: 3198 bytes
    Evaluating test case: valid_mint
      CPU: 31,067,157 | MEM: 130,146
  O2: 3196 bytes
    Evaluating test case: valid_mint
      CPU: 31,027,914 | MEM: 129,914
  O3: 1510 bytes
    Evaluating test case: valid_mint
      CPU: 28,259,914 | MEM: 112,614

============================================================
BINARY SIZE AND EXECUTION COST COMPARISON REPORT
============================================================

Contract: assert_sum
Description: Simple spending validator with assertion
----------------------------------------
  O0: 54,450 → 54,788 bytes (+338 bytes, +0.6%)
    Test 'valid_sum': CPU 44,089,759 → 44,041,759 (-48,000, -0.1%) | MEM 239,074 → 238,774 (-300, -0.1%) ↘️ (costs reduced)
  O1: 3,440 → 3,530 bytes (+90 bytes, +2.6%)
    Test 'valid_sum': CPU 19,353,759 → 19,545,759 (+192,000, +1.0%) | MEM 84,474 → 85,674 (+1,200, +1.4%)
  O2: 3,438 → 3,524 bytes (+86 bytes, +2.5%)
    Test 'valid_sum': CPU 19,314,516 → 19,506,516 (+192,000, +1.0%) | MEM 84,242 → 85,442 (+1,200, +1.4%)
  O3: 1,296 → 1,292 bytes (-4 bytes, -0.3%) ↘️ (size reduced)
    Test 'valid_sum': CPU 17,506,516 → 17,346,516 (-160,000, -0.9%) | MEM 72,942 → 71,942 (-1,000, -1.4%) ↘️ (costs reduced)

Contract: liquidity_pool
Description: Simple DEX pool
----------------------------------------
  O0: 151,088 → 151,504 bytes (+416 bytes, +0.3%)
  O1: 47,478 → 47,450 bytes (-28 bytes, -0.1%) ↘️ (size reduced)
  O2: 47,144 → 47,184 bytes (+40 bytes, +0.1%)
  O3: 18,544 → 18,284 bytes (-260 bytes, -1.4%) ↘️ (size reduced)

Contract: marketplace
Description: Marketplace contract with complex data structures
----------------------------------------
  O0: 123,448 → 123,792 bytes (+344 bytes, +0.3%)
  O1: 26,036 → 26,144 bytes (+108 bytes, +0.4%)
  O2: 25,940 → 26,048 bytes (+108 bytes, +0.4%)
  O3: 4,708 → 4,672 bytes (-36 bytes, -0.8%) ↘️ (size reduced)

Contract: gift
Description: Gift contract with simple logic
----------------------------------------
  O0: 56,918 → 57,260 bytes (+342 bytes, +0.6%)
    Test 'valid_withdrawal': CPU 51,588,498 → 51,540,498 (-48,000, -0.1%) | MEM 263,835 → 263,535 (-300, -0.1%) ↘️ (costs reduced)
  O1: 5,256 → 5,350 bytes (+94 bytes, +1.8%)
    Test 'valid_withdrawal': CPU 28,276,498 → 28,468,498 (+192,000, +0.7%) | MEM 118,135 → 119,335 (+1,200, +1.0%)
  O2: 5,252 → 5,344 bytes (+92 bytes, +1.8%)
    Test 'valid_withdrawal': CPU 28,198,012 → 28,390,012 (+192,000, +0.7%) | MEM 117,671 → 118,871 (+1,200, +1.0%)
  O3: 1,614 → 1,608 bytes (-6 bytes, -0.4%) ↘️ (size reduced)
    Test 'valid_withdrawal': CPU 25,702,012 → 25,542,012 (-160,000, -0.6%) | MEM 102,071 → 101,071 (-1,000, -1.0%) ↘️ (costs reduced)

Contract: wrapped_token
Description: Dual-use contract to generate a wrapped token
----------------------------------------
  O0: 64,204 → 64,542 bytes (+338 bytes, +0.5%)
  O1: 9,186 → 9,280 bytes (+94 bytes, +1.0%)
  O2: 8,906 → 8,992 bytes (+86 bytes, +1.0%)
  O3: 3,770 → 3,806 bytes (+36 bytes, +1.0%)

Contract: micropayments
Description: Channel for fee-less micropayments
----------------------------------------
  O0: 87,178 → 88,364 bytes (+1,186 bytes, +1.4%)
  O1: 19,562 → 20,820 bytes (+1,258 bytes, +6.4%) ⚠️ (ignored)
  O2: 19,488 → 20,746 bytes (+1,258 bytes, +6.5%) ⚠️
  O3: 6,918 → 7,096 bytes (+178 bytes, +2.6%)

Contract: pool_validator
Description: UPLC benchmark DEX pool validator
----------------------------------------
  O0: 62,488 → 63,204 bytes (+716 bytes, +1.1%)
    Test 'swap_a_for_b': CPU 155,211,202 → 144,496,682 (-10,714,520, -6.9%) | MEM 592,349 → 550,657 (-41,692, -7.0%) ↘️ (costs reduced)
    Test 'swap_b_for_a': CPU 155,211,202 → 144,496,682 (-10,714,520, -6.9%) | MEM 592,349 → 550,657 (-41,692, -7.0%) ↘️ (costs reduced)
    Test 'deposit': CPU 156,236,338 → 145,521,818 (-10,714,520, -6.9%) | MEM 581,899 → 540,207 (-41,692, -7.2%) ↘️ (costs reduced)
    Test 'withdraw': CPU 156,732,720 → 146,018,200 (-10,714,520, -6.8%) | MEM 584,201 → 542,509 (-41,692, -7.1%) ↘️ (costs reduced)
  O1: 10,670 → 11,202 bytes (+532 bytes, +5.0%)
    Test 'swap_a_for_b': CPU 142,651,202 → 128,848,682 (-13,802,520, -9.7%) | MEM 513,849 → 452,857 (-60,992, -11.9%) ↘️ (costs reduced)
    Test 'swap_b_for_a': CPU 142,651,202 → 128,848,682 (-13,802,520, -9.7%) | MEM 513,849 → 452,857 (-60,992, -11.9%) ↘️ (costs reduced)
    Test 'deposit': CPU 144,060,338 → 130,257,818 (-13,802,520, -9.6%) | MEM 505,799 → 444,807 (-60,992, -12.1%) ↘️ (costs reduced)
    Test 'withdraw': CPU 144,556,720 → 130,754,200 (-13,802,520, -9.5%) | MEM 508,101 → 447,109 (-60,992, -12.0%) ↘️ (costs reduced)
  O2: 10,234 → 10,756 bytes (+522 bytes, +5.1%) ⚠️
    Test 'swap_a_for_b': CPU 141,203,277 → 127,479,243 (-13,724,034, -9.7%) | MEM 505,419 → 444,891 (-60,528, -12.0%) ↘️ (costs reduced)
    Test 'swap_b_for_a': CPU 141,203,277 → 127,479,243 (-13,724,034, -9.7%) | MEM 505,419 → 444,891 (-60,528, -12.0%) ↘️ (costs reduced)
    Test 'deposit': CPU 143,103,366 → 129,379,332 (-13,724,034, -9.6%) | MEM 499,871 → 439,343 (-60,528, -12.1%) ↘️ (costs reduced)
    Test 'withdraw': CPU 143,567,748 → 129,843,714 (-13,724,034, -9.6%) | MEM 501,973 → 441,445 (-60,528, -12.1%) ↘️ (costs reduced)
  O3: 4,724 → 4,676 bytes (-48 bytes, -1.0%) ↘️ (size reduced)
    Test 'swap_a_for_b': CPU 136,643,277 → 120,219,315 (-16,423,962, -12.0%) | MEM 476,919 → 409,107 (-67,812, -14.2%) ↘️ (costs reduced)
    Test 'swap_b_for_a': CPU 136,643,277 → 120,219,315 (-16,423,962, -12.0%) | MEM 476,919 → 409,107 (-67,812, -14.2%) ↘️ (costs reduced)
    Test 'deposit': CPU 138,543,366 → 122,119,404 (-16,423,962, -11.9%) | MEM 471,371 → 403,559 (-67,812, -14.4%) ↘️ (costs reduced)
    Test 'withdraw': CPU 139,007,748 → 122,583,786 (-16,423,962, -11.8%) | MEM 473,473 → 405,661 (-67,812, -14.3%) ↘️ (costs reduced)

Contract: lp_minting_policy
Description: UPLC benchmark LP minting policy
----------------------------------------
  O0: 56,086 → 56,424 bytes (+338 bytes, +0.6%)
    Test 'mint_one_nft': CPU 54,116,929 → 54,068,929 (-48,000, -0.1%) | MEM 267,373 → 267,073 (-300, -0.1%) ↘️ (costs reduced)
    Test 'mint_two_nfts': CPU 71,389,257 → 71,341,257 (-48,000, -0.1%) | MEM 318,148 → 317,848 (-300, -0.1%) ↘️ (costs reduced)
  O1: 2,682 → 2,768 bytes (+86 bytes, +3.2%)
    Test 'mint_one_nft': CPU 28,740,929 → 28,932,929 (+192,000, +0.7%) | MEM 108,773 → 109,973 (+1,200, +1.1%)
    Test 'mint_two_nfts': CPU 47,005,257 → 47,197,257 (+192,000, +0.4%) | MEM 165,748 → 166,948 (+1,200, +0.7%)
  O2: 2,680 → 2,764 bytes (+84 bytes, +3.1%)
    Test 'mint_one_nft': CPU 28,701,686 → 28,893,686 (+192,000, +0.7%) | MEM 108,541 → 109,741 (+1,200, +1.1%)
    Test 'mint_two_nfts': CPU 46,926,771 → 47,118,771 (+192,000, +0.4%) | MEM 165,284 → 166,484 (+1,200, +0.7%)
  O3: 1,292 → 1,328 bytes (+36 bytes, +2.8%)
    Test 'mint_one_nft': CPU 27,309,686 → 27,501,686 (+192,000, +0.7%) | MEM 99,841 → 101,041 (+1,200, +1.2%)
    Test 'mint_two_nfts': CPU 45,534,771 → 45,726,771 (+192,000, +0.4%) | MEM 156,584 → 157,784 (+1,200, +0.8%)

Contract: nft_marketplace_validator
Description: UPLC benchmark NFT marketplace validator
----------------------------------------
  O0: 57,066 → 57,338 bytes (+272 bytes, +0.5%)
    Test 'buy_one': CPU 71,012,598 → 64,707,409 (-6,305,189, -8.9%) | MEM 334,783 → 308,335 (-26,448, -7.9%) ↘️ (costs reduced)
    Test 'cancel_one': CPU 62,220,036 → 55,914,847 (-6,305,189, -10.1%) | MEM 314,867 → 288,419 (-26,448, -8.4%) ↘️ (costs reduced)
  O1: 6,036 → 6,078 bytes (+42 bytes, +0.7%)
    Test 'buy_one': CPU 49,812,598 → 42,803,409 (-7,009,189, -14.1%) | MEM 202,283 → 171,435 (-30,848, -15.2%) ↘️ (costs reduced)
    Test 'cancel_one': CPU 40,620,036 → 33,610,847 (-7,009,189, -17.3%) | MEM 179,867 → 149,019 (-30,848, -17.2%) ↘️ (costs reduced)
  O2: 5,798 → 5,840 bytes (+42 bytes, +0.7%)
    Test 'buy_one': CPU 49,278,869 → 42,308,923 (-6,969,946, -14.1%) | MEM 198,987 → 168,371 (-30,616, -15.4%) ↘️ (costs reduced)
    Test 'cancel_one': CPU 40,093,550 → 33,123,604 (-6,969,946, -17.4%) | MEM 176,603 → 145,987 (-30,616, -17.3%) ↘️ (costs reduced)
  O3: 2,642 → 2,484 bytes (-158 bytes, -6.0%) ↘️ (size reduced)
    Test 'buy_one': CPU 46,878,869 → 39,061,941 (-7,816,928, -16.7%) | MEM 183,987 → 150,475 (-33,512, -18.2%) ↘️ (costs reduced)
    Test 'cancel_one': CPU 37,405,550 → 29,588,622 (-7,816,928, -20.9%) | MEM 159,803 → 126,291 (-33,512, -21.0%) ↘️ (costs reduced)

Contract: nft_minting_policy
Description: UPLC benchmark NFT minting policy
----------------------------------------
  O0: 56,194 → 56,470 bytes (+276 bytes, +0.5%)
    Test 'valid_mint': CPU 54,603,157 → 54,443,157 (-160,000, -0.3%) | MEM 277,246 → 276,246 (-1,000, -0.4%) ↘️ (costs reduced)
  O1: 3,180 → 3,198 bytes (+18 bytes, +0.6%)
    Test 'valid_mint': CPU 31,035,157 → 31,067,157 (+32,000, +0.1%) | MEM 129,946 → 130,146 (+200, +0.2%)
  O2: 3,178 → 3,196 bytes (+18 bytes, +0.6%)
    Test 'valid_mint': CPU 30,995,914 → 31,027,914 (+32,000, +0.1%) | MEM 129,714 → 129,914 (+200, +0.2%)
  O3: 1,488 → 1,510 bytes (+22 bytes, +1.5%)
    Test 'valid_mint': CPU 28,179,914 → 28,259,914 (+80,000, +0.3%) | MEM 112,114 → 112,614 (+500, +0.4%)

Total size change compared to previous release: +8,956 bytes

⚠️  SIGNIFICANT CHANGES DETECTED
Please review the changes and consider optimization if sizes or costs increased significantly.
============================================================

Please review the binary size changes. Significant increases may impact contract deployment costs and execution limits.


This report compares the binary sizes of compiled contracts against the baseline from the latest release.

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