Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sanity check opcode gas prices by executing the block with pre-defined gas limit #1386

Closed
7 of 8 tasks
xgreenx opened this issue Sep 28, 2023 · 1 comment
Closed
7 of 8 tasks
Assignees

Comments

@xgreenx
Copy link
Collaborator

xgreenx commented Sep 28, 2023

Write a benchmark for each opcode in benches/benches/block_target_gas.rs and compare results with each other. The final goal is to have approximately the same execution time for each opcode.

The benchmark should create the worst possible scenario. It requires knowledge of how opcode works internally. You can look into the implementation of each opcode on the fuel-vm side to get a better understanding of what can affect the execution time.

@xgreenx xgreenx assigned Dentosal and MitchTurner and unassigned Dentosal Sep 28, 2023
MitchTurner added a commit that referenced this issue Oct 17, 2023
#1386

This PR adds benchmark tests for all the arithmetic op codes. The actual
purpose being running those tests to see if the costs actually line up
for all the codes.

These tests work by starting a vm with a set amount of gas, and running
an "infinite" loop of each op code until the vm runs out of gas. This is
timed and the time is reported.

After running these, I've found a number of divergent op codes that
could possibly require updated gas costs:
```
block target estimation/wddv opcode
                        time:   [4.0950 ms 4.1181 ms 4.1411 ms]
block target estimation/wdmd opcode
                        time:   [3.3510 ms 3.3710 ms 3.3931 ms]
block target estimation/wdam opcode
                        time:   [3.4912 ms 3.5138 ms 3.5363 ms]
block target estimation/wdmm opcode
                        time:   [3.4505 ms 3.4686 ms 3.4868 ms]
block target estimation/wqdv opcode
                        time:   [3.2404 ms 3.2590 ms 3.2796 ms]
block target estimation/wqmd opcode
                        time:   [4.1508 ms 4.1716 ms 4.1928 ms]
block target estimation/wqam opcode
                        time:   [3.6933 ms 3.7081 ms 3.7230 ms]
block target estimation/wqmm opcode
                        time:   [5.2120 ms 5.2395 ms 5.2667 ms]
```
So, that's `wddv`, `wdmd`, `wdam`, `wdmm`, `wqdv`, `wqmd`, `wqam`,
`wqmm`.

Whereas all the other op codes take close to 2ms to run out of gas,
implying that these divergent op codes could be priced higher. These
"wide" op codes all share similar setup, and not all of the "wide" op
codes fail the test, so it's _probably_ not the setup that is causing
these specific op code benchmarks to fail.

***

Here are all of the results:
```
lock target estimation/add opcode
                        time:   [2.1024 ms 2.1142 ms 2.1259 ms]
block target estimation/addi opcode
                        time:   [2.1066 ms 2.1208 ms 2.1369 ms]
block target estimation/aloc opcode
                        time:   [1.8966 ms 1.9104 ms 1.9252 ms]
block target estimation/and opcode
                        time:   [2.0765 ms 2.0877 ms 2.0990 ms]
block target estimation/andi opcode
                        time:   [2.1647 ms 2.1797 ms 2.1963 ms]
block target estimation/div opcode
                        time:   [2.1176 ms 2.1303 ms 2.1440 ms]
block target estimation/divi opcode
                        time:   [2.1445 ms 2.1572 ms 2.1711 ms]
block target estimation/eq opcode
                        time:   [2.0585 ms 2.0721 ms 2.0859 ms]
block target estimation/exp opcode
                        time:   [2.0829 ms 2.0931 ms 2.1031 ms]
block target estimation/expi opcode
                        time:   [2.1114 ms 2.1218 ms 2.1323 ms]
block target estimation/gt opcode
                        time:   [2.0068 ms 2.0176 ms 2.0287 ms]
block target estimation/gtf opcode
                        time:   [2.2672 ms 2.2765 ms 2.2859 ms]
block target estimation/lt opcode
                        time:   [1.9848 ms 1.9959 ms 2.0070 ms]
block target estimation/mlog opcode
                        time:   [2.0176 ms 2.0278 ms 2.0380 ms]
block target estimation/mod opcode
                        time:   [1.9694 ms 1.9819 ms 1.9943 ms]
block target estimation/modi opcode
                        time:   [1.9519 ms 1.9640 ms 1.9760 ms]
block target estimation/move opcode
                        time:   [1.8479 ms 1.8600 ms 1.8716 ms]
block target estimation/movi opcode
                        time:   [1.9531 ms 1.9645 ms 1.9758 ms]
block target estimation/mroo opcode
                        time:   [2.4029 ms 2.4151 ms 2.4272 ms]
block target estimation/mul opcode
                        time:   [2.0221 ms 2.0335 ms 2.0446 ms]
block target estimation/muli opcode
                        time:   [1.9674 ms 1.9781 ms 1.9897 ms]
block target estimation/noop opcode
                        time:   [1.8149 ms 1.8389 ms 1.8631 ms]
block target estimation/not opcode
                        time:   [1.8706 ms 1.8861 ms 1.9008 ms]
block target estimation/or opcode
                        time:   [2.0889 ms 2.0994 ms 2.1111 ms]
block target estimation/ori opcode
                        time:   [2.1002 ms 2.1106 ms 2.1208 ms]
block target estimation/sll opcode
                        time:   [2.1776 ms 2.1864 ms 2.1956 ms]
block target estimation/slli opcode
                        time:   [2.0932 ms 2.1038 ms 2.1153 ms]
block target estimation/srl opcode
                        time:   [2.0355 ms 2.0453 ms 2.0555 ms]
block target estimation/srli opcode
                        time:   [2.0444 ms 2.0509 ms 2.0578 ms]
block target estimation/sub opcode
                        time:   [2.1181 ms 2.1269 ms 2.1358 ms]
block target estimation/subi opcode
                        time:   [1.9773 ms 1.9905 ms 2.0050 ms]
block target estimation/xor opcode
                        time:   [2.0735 ms 2.0837 ms 2.0937 ms]
block target estimation/xori opcode
                        time:   [2.0139 ms 2.0246 ms 2.0354 ms]
block target estimation/wdcm opcode
                        time:   [2.2144 ms 2.2272 ms 2.2406 ms]
block target estimation/wdop opcode
                        time:   [2.5049 ms 2.5220 ms 2.5395 ms]
block target estimation/wdml opcode
                        time:   [2.6808 ms 2.6963 ms 2.7130 ms]
block target estimation/wddv opcode
                        time:   [4.2766 ms 4.3064 ms 4.3368 ms]
block target estimation/wdmd opcode
                        time:   [3.5144 ms 3.5451 ms 3.5798 ms]
block target estimation/wdam opcode
                        time:   [3.7095 ms 3.7397 ms 3.7760 ms]
block target estimation/wdmm opcode
                        time:   [3.6330 ms 3.6595 ms 3.6915 ms]
block target estimation/wqcm opcode
                        time:   [2.4236 ms 2.4410 ms 2.4597 ms]
block target estimation/wqop opcode
                        time:   [2.7717 ms 2.7920 ms 2.8154 ms]
block target estimation/wqml opcode
                        time:   [2.9315 ms 2.9631 ms 2.9986 ms]
block target estimation/wqdv opcode
                        time:   [3.4322 ms 3.4572 ms 3.4846 ms]
block target estimation/wqmd opcode
                        time:   [4.4126 ms 4.4383 ms 4.4669 ms]
block target estimation/wqam opcode
                        time:   [3.8279 ms 3.8610 ms 3.8986 ms]
block target estimation/wqmm opcode
                        time:   [5.8005 ms 5.8658 ms 5.9469 ms]
  ```

---------

Co-authored-by: Brandon Vrooman <brandon.vrooman@gmail.com>
Co-authored-by: xgreenx <xgreenx9999@gmail.com>
xgreenx added a commit that referenced this issue Oct 23, 2023
#1386

Results:
```
block target estimation/crypto/eck1 opcode
                        time:   [4.8418 ms 4.8650 ms 4.8882 ms]
block target estimation/crypto/ecr1 opcode
                        time:   [18.634 ms 18.791 ms 18.992 ms]
block target estimation/crypto/ed19 opcode
                        time:   [2.6451 ms 2.6698 ms 2.6963 ms]
```
s256:
```
block target estimation/crypto/s256 opcode 1
                        time:   [3.1244 ms 3.1409 ms 3.1575 ms]
Found 6 outliers among 100 measurements (6.00%)
  3 (3.00%) low mild
  3 (3.00%) high mild
block target estimation/crypto/s256 opcode 10
                        time:   [3.1082 ms 3.1299 ms 3.1515 ms]
Found 2 outliers among 100 measurements (2.00%)
  1 (1.00%) low mild
  1 (1.00%) high severe
block target estimation/crypto/s256 opcode 100
                        time:   [4.1553 ms 4.1781 ms 4.2026 ms]
block target estimation/crypto/s256 opcode 1000
                        time:   [8.3133 ms 8.3554 ms 8.3990 ms]
block target estimation/crypto/s256 opcode 10000
                        time:   [10.562 ms 10.611 ms 10.661 ms]
block target estimation/crypto/s256 opcode 19753
                        time:   [10.794 ms 10.847 ms 10.902 ms]
block target estimation/crypto/s256 opcode 29629
                        time:   [10.694 ms 10.773 ms 10.853 ms]
block target estimation/crypto/s256 opcode 44444
                        time:   [10.724 ms 10.795 ms 10.870 ms]
block target estimation/crypto/s256 opcode 66666
                        time:   [10.745 ms 10.810 ms 10.879 ms]
block target estimation/crypto/s256 opcode 100000
                        time:   [10.551 ms 10.608 ms 10.665 ms]
```

k256:
```
block target estimation/crypto/k256 opcode 1
                        time:   [4.0653 ms 4.0881 ms 4.1123 ms]
block target estimation/crypto/k256 opcode 10
                        time:   [4.0803 ms 4.1121 ms 4.1500 ms]
block target estimation/crypto/k256 opcode 100
                        time:   [3.9216 ms 3.9472 ms 3.9730 ms]
block target estimation/crypto/k256 opcode 1000
                        time:   [19.240 ms 19.610 ms 20.102 ms]
block target estimation/crypto/k256 opcode 10000
                        time:   [46.020 ms 46.250 ms 46.491 ms]
Benchmarking block target estimation/crypto/k256 opcode 19753: Warming up for 3.0000 s
Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 5.0s, or reduce sample count to 90.
block target estimation/crypto/k256 opcode 19753
                        time:   [51.484 ms 51.795 ms 52.121 ms]
Benchmarking block target estimation/crypto/k256 opcode 29629: Warming up for 3.0000 s
Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 5.1s, or reduce sample count to 90.
block target estimation/crypto/k256 opcode 29629
                        time:   [53.408 ms 54.647 ms 56.676 ms]
Benchmarking block target estimation/crypto/k256 opcode 44444: Warming up for 3.0000 s
Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 5.2s, or reduce sample count to 90.
block target estimation/crypto/k256 opcode 44444
                        time:   [54.142 ms 54.426 ms 54.716 ms]
Benchmarking block target estimation/crypto/k256 opcode 66666: Warming up for 3.0000 s
Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 5.3s, or reduce sample count to 90.
block target estimation/crypto/k256 opcode 66666
                        time:   [55.453 ms 55.730 ms 56.009 ms]
Benchmarking block target estimation/crypto/k256 opcode 100000: Warming up for 3.0000 s
Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 5.4s, or reduce sample count to 90.
block target estimation/crypto/k256 opcode 100000
                        time:   [54.617 ms 55.698 ms 57.215 ms]
```

---------

Co-authored-by: Green Baneling <XgreenX9999@gmail.com>
xgreenx added a commit that referenced this issue Oct 24, 2023
#1386

```
block target estimation/flow/jmp opcode
                        time:   [1.9838 ms 1.9917 ms 2.0001 ms]
block target estimation/flow/ji opcode
                        time:   [1.6020 ms 1.6119 ms 1.6223 ms]
block target estimation/flow/jne opcode
                        time:   [2.2373 ms 2.2479 ms 2.2589 ms]
block target estimation/flow/jnei opcode
                        time:   [2.0990 ms 2.1085 ms 2.1176 ms]
block target estimation/flow/jnzi opcode
                        time:   [1.9626 ms 1.9776 ms 1.9930 ms]
block target estimation/flow/jmpb opcode
                        time:   [1.5740 ms 1.5819 ms 1.5904 ms]
block target estimation/flow/jmpf opcode
                        time:   [1.5385 ms 1.5455 ms 1.5529 ms]
block target estimation/flow/jnzb opcode true
                        time:   [1.6174 ms 1.6246 ms 1.6323 ms]
block target estimation/flow/jnzb opcode false
                        time:   [1.6395 ms 1.6482 ms 1.6568 ms]
block target estimation/flow/jnzf opcode true
                        time:   [1.5932 ms 1.5999 ms 1.6070 ms]
block target estimation/flow/jnzf opcode false
                        time:   [1.6132 ms 1.6227 ms 1.6333 ms]
block target estimation/flow/jne opcode
                        time:   [1.7591 ms 1.7703 ms 1.7822 ms]
block target estimation/flow/jnei opcode
                        time:   [1.5247 ms 1.5340 ms 1.5447 ms]
block target estimation/flow/jneb opcode not equal
                        time:   [1.6881 ms 1.6961 ms 1.7057 ms]
block target estimation/flow/jneb opcode equal
                        time:   [1.7255 ms 1.7362 ms 1.7481 ms]
block target estimation/flow/jnef opcode not equal
                        time:   [1.8018 ms 1.8132 ms 1.8259 ms]
block target estimation/flow/jnef opcode equal
                        time:   [1.7644 ms 1.7731 ms 1.7823 ms]
```

Not sure how to test `ret_script` or `ret_contract` with an infinite
loop 🤷

---------

Co-authored-by: Green Baneling <XgreenX9999@gmail.com>
MitchTurner added a commit that referenced this issue Oct 24, 2023
#1386

```
block target estimation/memory/aloc opcode
                        time:   [1.7153 ms 1.7225 ms 1.7304 ms]
block target estimation/memory/cfe opcode
                        time:   [1.6035 ms 1.6133 ms 1.6242 ms]
block target estimation/memory/cfei opcode
                        time:   [1.6067 ms 1.6161 ms 1.6261 ms]
block target estimation/memory/cfs opcode
                        time:   [1.5815 ms 1.5926 ms 1.6051 ms]
block target estimation/memory/cfsi opcode
                        time:   [1.6355 ms 1.6428 ms 1.6513 ms]
block target estimation/memory/lb opcode
                        time:   [1.7495 ms 1.7592 ms 1.7703 ms]
block target estimation/memory/lw opcode
                        time:   [1.7579 ms 1.7699 ms 1.7828 ms]
block target estimation/memory/mcl opcode 1
                        time:   [2.1388 ms 2.1553 ms 2.1799 ms]
block target estimation/memory/mcl opcode 10
                        time:   [2.1554 ms 2.1661 ms 2.1769 ms]
block target estimation/memory/mcl opcode 100
                        time:   [2.1288 ms 2.1415 ms 2.1547 ms]
block target estimation/memory/mcl opcode 1000
                        time:   [2.7993 ms 2.8172 ms 2.8354 ms]
block target estimation/memory/mcl opcode 10000
                        time:   [4.0290 ms 4.0541 ms 4.0791 ms]
block target estimation/memory/mcl opcode 19753
                        time:   [4.9775 ms 5.0025 ms 5.0281 ms]
block target estimation/memory/mcl opcode 29629
                        time:   [5.0122 ms 5.0411 ms 5.0712 ms]
block target estimation/memory/mcl opcode 44444
                        time:   [4.9450 ms 4.9724 ms 5.0005 ms]
block target estimation/memory/mcl opcode 66666
                        time:   [4.9388 ms 4.9640 ms 4.9899 ms]
block target estimation/memory/mcl opcode 100000
                        time:   [4.9764 ms 5.0030 ms 5.0310 ms]
block target estimation/memory/mcli opcode 1
                        time:   [2.0453 ms 2.0548 ms 2.0648 ms]
block target estimation/memory/mcli opcode 10
                        time:   [2.0375 ms 2.0480 ms 2.0585 ms]
block target estimation/memory/mcli opcode 100
                        time:   [2.0586 ms 2.0684 ms 2.0784 ms]
block target estimation/memory/mcli opcode 1000
                        time:   [2.7113 ms 2.7287 ms 2.7477 ms]
block target estimation/memory/mcli opcode 10000
                        time:   [3.9312 ms 3.9568 ms 3.9852 ms]
block target estimation/memory/mcli opcode 19753
                        time:   [4.9118 ms 4.9353 ms 4.9589 ms]
block target estimation/memory/mcli opcode 29629
                        time:   [4.9363 ms 4.9627 ms 4.9899 ms]
block target estimation/memory/mcli opcode 44444
                        time:   [4.8455 ms 4.8674 ms 4.8902 ms]
block target estimation/memory/mcli opcode 66666
                        time:   [4.8760 ms 4.9036 ms 4.9337 ms]
block target estimation/memory/mcli opcode 100000
                        time:   [4.9923 ms 5.0176 ms 5.0431 ms]
block target estimation/memory/mcp opcode 1
                        time:   [2.2783 ms 2.2892 ms 2.3000 ms]
block target estimation/memory/mcp opcode 10
                        time:   [2.2653 ms 2.2751 ms 2.2855 ms]
block target estimation/memory/mcp opcode 100
                        time:   [2.3478 ms 2.3608 ms 2.3740 ms]
block target estimation/memory/mcp opcode 1000
                        time:   [2.6947 ms 2.7140 ms 2.7390 ms]
block target estimation/memory/mcp opcode 10000
                        time:   [2.9727 ms 2.9851 ms 2.9976 ms]
block target estimation/memory/mcp opcode 19753
                        time:   [4.0645 ms 4.0992 ms 4.1429 ms]
block target estimation/memory/mcp opcode 29629
                        time:   [4.5143 ms 4.5370 ms 4.5602 ms]
block target estimation/memory/mcp opcode 44444
                        time:   [4.6528 ms 4.6742 ms 4.6967 ms]
block target estimation/memory/mcp opcode 66666
                        time:   [4.6505 ms 4.6744 ms 4.7010 ms]
block target estimation/memory/mcp opcode 100000
                        time:   [3.5548 ms 3.5713 ms 3.5883 ms]
block target estimation/memory/mcpi opcode 1
                        time:   [1.2296 ms 1.2352 ms 1.2405 ms]
block target estimation/memory/mcpi opcode 10
                        time:   [1.2135 ms 1.2188 ms 1.2240 ms]
block target estimation/memory/mcpi opcode 100
                        time:   [1.2760 ms 1.2816 ms 1.2873 ms]
block target estimation/memory/mcpi opcode 1000
                        time:   [1.4219 ms 1.4307 ms 1.4398 ms]
block target estimation/memory/meq opcode 1
                        time:   [1.9330 ms 1.9430 ms 1.9534 ms]
block target estimation/memory/meq opcode 10
                        time:   [1.9648 ms 1.9738 ms 1.9830 ms]
block target estimation/memory/meq opcode 100
                        time:   [1.9911 ms 2.0000 ms 2.0092 ms]
block target estimation/memory/meq opcode 1000
                        time:   [2.4182 ms 2.4293 ms 2.4405 ms]
block target estimation/memory/meq opcode 10000
                        time:   [3.3582 ms 3.3748 ms 3.3913 ms]
block target estimation/memory/meq opcode 19753
                        time:   [4.0710 ms 4.0870 ms 4.1029 ms]
block target estimation/memory/meq opcode 29629
                        time:   [4.0880 ms 4.1121 ms 4.1450 ms]
block target estimation/memory/meq opcode 44444
                        time:   [4.0922 ms 4.1076 ms 4.1230 ms]
block target estimation/memory/meq opcode 66666
                        time:   [4.1181 ms 4.1365 ms 4.1550 ms]
block target estimation/memory/meq opcode 100000
                        time:   [4.0834 ms 4.1013 ms 4.1201 ms]
block target estimation/memory/poph opcode
                        time:   [1.5574 ms 1.5661 ms 1.5745 ms]
block target estimation/memory/popl opcode
                        time:   [1.4805 ms 1.4882 ms 1.4964 ms]
block target estimation/memory/pshh opcode
                        time:   [3.6456 ms 3.6765 ms 3.7107 ms]
block target estimation/memory/pshl opcode
                        time:   [3.5495 ms 3.5675 ms 3.5862 ms]
block target estimation/memory/sb opcode
                        time:   [1.8727 ms 1.8832 ms 1.8946 ms]
block target estimation/memory/sw opcode
                        time:   [1.8648 ms 1.8746 ms 1.8846 ms]
```

---------

Co-authored-by: xgreenx <xgreenx9999@gmail.com>
MitchTurner added a commit that referenced this issue Nov 15, 2023
#1386
```
block target estimation/contract/bal contract
                        time:   [1.4691 ms 1.4723 ms 1.4758 ms]
block target estimation/contract/bal script
                        time:   [22.914 ms 22.954 ms 22.997 ms]
block target estimation/contract/bhei
                        time:   [2.5669 ms 2.5785 ms 2.5903 ms]
block target estimation/contract/bhsh
                        time:   [3.1837 ms 3.1990 ms 3.2147 ms]
block target estimation/contract/burn
                        time:   [108.90 ms 109.19 ms 109.48 ms]
block target estimation/contract/call 1
                        time:   [71.952 ms 72.085 ms 72.225 ms]
block target estimation/contract/call 10
                        time:   [69.186 ms 69.357 ms 69.526 ms]
block target estimation/contract/call 100
                        time:   [44.121 ms 44.225 ms 44.335 ms]
block target estimation/contract/call 1000
                        time:   [11.294 ms 11.318 ms 11.343 ms]
block target estimation/contract/call 10000
                        time:   [2.8902 ms 2.8962 ms 2.9024 ms]
block target estimation/contract/call 19753
                        time:   [2.4352 ms 2.4473 ms 2.4673 ms]
block target estimation/contract/call 29629
                        time:   [2.1797 ms 2.1898 ms 2.2043 ms]
block target estimation/contract/call 44444
                        time:   [2.1112 ms 2.1173 ms 2.1237 ms]
block target estimation/contract/call 66666
                        time:   [2.0530 ms 2.0610 ms 2.0691 ms]
block target estimation/contract/call 100000
                        time:   [1.9275 ms 1.9322 ms 1.9387 ms]
block target estimation/contract/cb
                        time:   [2.8728 ms 2.8836 ms 2.8946 ms]
block target estimation/contract/ccp 1
                        time:   [3.9833 ms 4.0033 ms 4.0309 ms]
block target estimation/contract/ccp 10
                        time:   [4.2070 ms 4.2235 ms 4.2427 ms]
block target estimation/contract/ccp 100
                        time:   [4.4203 ms 4.4391 ms 4.4574 ms]
block target estimation/contract/ccp 1000
                        time:   [3.7655 ms 3.7747 ms 3.7840 ms]
block target estimation/contract/ccp 10000
                        time:   [4.0406 ms 4.0589 ms 4.0775 ms]
block target estimation/contract/ccp 19753
                        time:   [3.5811 ms 3.5896 ms 3.5981 ms]
block target estimation/contract/ccp 29629
                        time:   [3.4583 ms 3.4839 ms 3.5158 ms]
block target estimation/contract/ccp 44444
                        time:   [3.4880 ms 3.4981 ms 3.5081 ms]
block target estimation/contract/ccp 66666
                        time:   [3.5190 ms 3.5329 ms 3.5514 ms]
block target estimation/contract/ccp 100000
                        time:   [3.4854 ms 3.4964 ms 3.5076 ms]
block target estimation/contract/croo
                        time:   [67.070 ms 67.253 ms 67.441 ms]
block target estimation/contract/csiz 1
                        time:   [3.1927 ms 3.2046 ms 3.2171 ms]
block target estimation/contract/csiz 10
                        time:   [3.3017 ms 3.3142 ms 3.3277 ms]
block target estimation/contract/csiz 100
                        time:   [3.4821 ms 3.4920 ms 3.5020 ms]
block target estimation/contract/csiz 1000
                        time:   [3.0014 ms 3.0087 ms 3.0167 ms]
block target estimation/contract/csiz 10000
                        time:   [3.2728 ms 3.2823 ms 3.2926 ms]
block target estimation/contract/csiz 19753
                        time:   [2.7656 ms 2.7722 ms 2.7794 ms]
block target estimation/contract/csiz 29629
                        time:   [2.6209 ms 2.6371 ms 2.6585 ms]
block target estimation/contract/csiz 44444
                        time:   [2.4669 ms 2.4798 ms 2.4940 ms]
block target estimation/contract/csiz 66666
                        time:   [2.4630 ms 2.4692 ms 2.4758 ms]
block target estimation/contract/csiz 100000
                        time:   [2.4514 ms 2.4616 ms 2.4762 ms]
block target estimation/contract/ldc 1
                        time:   [4.2252 ms 4.2377 ms 4.2506 ms]
block target estimation/contract/ldc 10
                        time:   [4.4222 ms 4.4362 ms 4.4503 ms]
block target estimation/contract/ldc 100
                        time:   [4.4831 ms 4.4936 ms 4.5046 ms]
block target estimation/contract/ldc 1000
                        time:   [4.2607 ms 4.2739 ms 4.2881 ms]
block target estimation/contract/ldc 10000
                        time:   [4.7586 ms 4.7841 ms 4.8157 ms]
block target estimation/contract/ldc 19753
                        time:   [4.6346 ms 4.6492 ms 4.6643 ms]
block target estimation/contract/ldc 29629
                        time:   [4.4694 ms 4.4880 ms 4.5071 ms]
block target estimation/contract/ldc 44444
                        time:   [4.4017 ms 4.4225 ms 4.4500 ms]
block target estimation/contract/ldc 66666
                        time:   [4.3336 ms 4.3425 ms 4.3516 ms]
block target estimation/contract/ldc 100000
                        time:   [4.4381 ms 4.4566 ms 4.4749 ms]
block target estimation/contract/log
                        time:   [10.256 ms 10.303 ms 10.350 ms]
block target estimation/contract/logd 1
                        time:   [4.1894 ms 4.2067 ms 4.2251 ms]
block target estimation/contract/logd 10
                        time:   [4.4084 ms 4.4381 ms 4.4722 ms]
block target estimation/contract/logd 100
                        time:   [5.3502 ms 5.4004 ms 5.4666 ms]
block target estimation/contract/logd 1000
                        time:   [13.050 ms 13.135 ms 13.223 ms]
block target estimation/contract/logd 10000
                        time:   [27.383 ms 27.628 ms 27.887 ms]
block target estimation/contract/logd 19753
                        time:   [29.407 ms 29.729 ms 30.055 ms]
block target estimation/contract/logd 29629
                        time:   [33.715 ms 44.027 ms 57.000 ms]
block target estimation/contract/logd 44444
                        time:   [33.105 ms 42.521 ms 54.599 ms]
block target estimation/contract/logd 66666
                        time:   [30.631 ms 30.949 ms 31.279 ms]
block target estimation/contract/logd 100000
                        time:   [30.155 ms 40.772 ms 54.713 ms]
block target estimation/contract/mint
                        time:   [98.285 ms 99.414 ms 100.69 ms]
block target estimation/contract/ret contract
                        time:   [73.189 ms 73.373 ms 73.580 ms]
block target estimation/contract/retd contract 1
                        time:   [65.356 ms 65.477 ms 65.600 ms]
block target estimation/contract/retd contract 10
                        time:   [66.407 ms 66.503 ms 66.604 ms]
block target estimation/contract/retd contract 100
                        time:   [66.665 ms 66.843 ms 67.024 ms]
block target estimation/contract/retd contract 1000
                        time:   [61.910 ms 62.100 ms 62.305 ms]
block target estimation/contract/retd contract 10000
                        time:   [49.114 ms 49.293 ms 49.474 ms]
block target estimation/contract/retd contract 19753
                        time:   [41.567 ms 41.799 ms 42.039 ms]
block target estimation/contract/retd contract 29629
                        time:   [40.203 ms 45.726 ms 56.567 ms]
block target estimation/contract/retd contract 44444
                        time:   [43.955 ms 58.338 ms 75.298 ms]
block target estimation/contract/retd contract 66666
                        time:   [36.076 ms 36.297 ms 36.520 ms]
block target estimation/contract/retd contract 100000
                        time:   [33.281 ms 33.629 ms 34.039 ms]
block target estimation/contract/smo 1
                        time:   [65.119 ms 65.588 ms 66.177 ms]
block target estimation/contract/smo 10
                        time:   [63.433 ms 63.720 ms 64.141 ms]
block target estimation/contract/smo 100
                        time:   [61.177 ms 61.465 ms 61.839 ms]
block target estimation/contract/smo 1000
                        time:   [59.890 ms 60.007 ms 60.134 ms]
block target estimation/contract/smo 10000
                        time:   [51.135 ms 51.444 ms 51.793 ms]
block target estimation/contract/smo 19753
                        time:   [45.648 ms 45.967 ms 46.336 ms]
block target estimation/contract/smo 29629
                        time:   [55.496 ms 69.138 ms 84.636 ms]
block target estimation/contract/smo 44444
                        time:   [50.462 ms 65.771 ms 83.605 ms]
block target estimation/contract/smo 66666
                        time:   [37.880 ms 38.247 ms 38.722 ms]
block target estimation/contract/smo 100000
                        time:   [33.433 ms 33.628 ms 33.823 ms]
block target estimation/contract/srw
                        time:   [73.681 ms 73.943 ms 74.347 ms]
block target estimation/contract/sww
                        time:   [111.88 ms 112.64 ms 113.41 ms]
block target estimation/contract/time
                        time:   [64.179 ms 64.539 ms 64.899 ms]
block target estimation/contract/tr
                        time:   [128.13 ms 128.49 ms 128.94 ms]
```

---------

Co-authored-by: Hannes Karppila <hannes.karppila@gmail.com>
Co-authored-by: xgreenx <xgreenx9999@gmail.com>
xgreenx added a commit that referenced this issue Nov 16, 2023
#1386
```
block target estimation/other/flag
                        time:   [27.326 ms 27.458 ms 27.603 ms]
block target estimation/other/gm
                        time:   [7.7485 ms 7.7831 ms 7.8231 ms]
```

---------

Co-authored-by: Hannes Karppila <hannes.karppila@gmail.com>
Co-authored-by: xgreenx <xgreenx9999@gmail.com>
@xgreenx
Copy link
Collaborator Author

xgreenx commented Nov 22, 2023

Done across several pull requests

@xgreenx xgreenx closed this as completed Nov 22, 2023
GoldenPath1109 added a commit to GoldenPath1109/fuel-core that referenced this issue Sep 7, 2024
FuelLabs/fuel-core#1386

This PR adds benchmark tests for all the arithmetic op codes. The actual
purpose being running those tests to see if the costs actually line up
for all the codes.

These tests work by starting a vm with a set amount of gas, and running
an "infinite" loop of each op code until the vm runs out of gas. This is
timed and the time is reported.

After running these, I've found a number of divergent op codes that
could possibly require updated gas costs:
```
block target estimation/wddv opcode
                        time:   [4.0950 ms 4.1181 ms 4.1411 ms]
block target estimation/wdmd opcode
                        time:   [3.3510 ms 3.3710 ms 3.3931 ms]
block target estimation/wdam opcode
                        time:   [3.4912 ms 3.5138 ms 3.5363 ms]
block target estimation/wdmm opcode
                        time:   [3.4505 ms 3.4686 ms 3.4868 ms]
block target estimation/wqdv opcode
                        time:   [3.2404 ms 3.2590 ms 3.2796 ms]
block target estimation/wqmd opcode
                        time:   [4.1508 ms 4.1716 ms 4.1928 ms]
block target estimation/wqam opcode
                        time:   [3.6933 ms 3.7081 ms 3.7230 ms]
block target estimation/wqmm opcode
                        time:   [5.2120 ms 5.2395 ms 5.2667 ms]
```
So, that's `wddv`, `wdmd`, `wdam`, `wdmm`, `wqdv`, `wqmd`, `wqam`,
`wqmm`.

Whereas all the other op codes take close to 2ms to run out of gas,
implying that these divergent op codes could be priced higher. These
"wide" op codes all share similar setup, and not all of the "wide" op
codes fail the test, so it's _probably_ not the setup that is causing
these specific op code benchmarks to fail.

***

Here are all of the results:
```
lock target estimation/add opcode
                        time:   [2.1024 ms 2.1142 ms 2.1259 ms]
block target estimation/addi opcode
                        time:   [2.1066 ms 2.1208 ms 2.1369 ms]
block target estimation/aloc opcode
                        time:   [1.8966 ms 1.9104 ms 1.9252 ms]
block target estimation/and opcode
                        time:   [2.0765 ms 2.0877 ms 2.0990 ms]
block target estimation/andi opcode
                        time:   [2.1647 ms 2.1797 ms 2.1963 ms]
block target estimation/div opcode
                        time:   [2.1176 ms 2.1303 ms 2.1440 ms]
block target estimation/divi opcode
                        time:   [2.1445 ms 2.1572 ms 2.1711 ms]
block target estimation/eq opcode
                        time:   [2.0585 ms 2.0721 ms 2.0859 ms]
block target estimation/exp opcode
                        time:   [2.0829 ms 2.0931 ms 2.1031 ms]
block target estimation/expi opcode
                        time:   [2.1114 ms 2.1218 ms 2.1323 ms]
block target estimation/gt opcode
                        time:   [2.0068 ms 2.0176 ms 2.0287 ms]
block target estimation/gtf opcode
                        time:   [2.2672 ms 2.2765 ms 2.2859 ms]
block target estimation/lt opcode
                        time:   [1.9848 ms 1.9959 ms 2.0070 ms]
block target estimation/mlog opcode
                        time:   [2.0176 ms 2.0278 ms 2.0380 ms]
block target estimation/mod opcode
                        time:   [1.9694 ms 1.9819 ms 1.9943 ms]
block target estimation/modi opcode
                        time:   [1.9519 ms 1.9640 ms 1.9760 ms]
block target estimation/move opcode
                        time:   [1.8479 ms 1.8600 ms 1.8716 ms]
block target estimation/movi opcode
                        time:   [1.9531 ms 1.9645 ms 1.9758 ms]
block target estimation/mroo opcode
                        time:   [2.4029 ms 2.4151 ms 2.4272 ms]
block target estimation/mul opcode
                        time:   [2.0221 ms 2.0335 ms 2.0446 ms]
block target estimation/muli opcode
                        time:   [1.9674 ms 1.9781 ms 1.9897 ms]
block target estimation/noop opcode
                        time:   [1.8149 ms 1.8389 ms 1.8631 ms]
block target estimation/not opcode
                        time:   [1.8706 ms 1.8861 ms 1.9008 ms]
block target estimation/or opcode
                        time:   [2.0889 ms 2.0994 ms 2.1111 ms]
block target estimation/ori opcode
                        time:   [2.1002 ms 2.1106 ms 2.1208 ms]
block target estimation/sll opcode
                        time:   [2.1776 ms 2.1864 ms 2.1956 ms]
block target estimation/slli opcode
                        time:   [2.0932 ms 2.1038 ms 2.1153 ms]
block target estimation/srl opcode
                        time:   [2.0355 ms 2.0453 ms 2.0555 ms]
block target estimation/srli opcode
                        time:   [2.0444 ms 2.0509 ms 2.0578 ms]
block target estimation/sub opcode
                        time:   [2.1181 ms 2.1269 ms 2.1358 ms]
block target estimation/subi opcode
                        time:   [1.9773 ms 1.9905 ms 2.0050 ms]
block target estimation/xor opcode
                        time:   [2.0735 ms 2.0837 ms 2.0937 ms]
block target estimation/xori opcode
                        time:   [2.0139 ms 2.0246 ms 2.0354 ms]
block target estimation/wdcm opcode
                        time:   [2.2144 ms 2.2272 ms 2.2406 ms]
block target estimation/wdop opcode
                        time:   [2.5049 ms 2.5220 ms 2.5395 ms]
block target estimation/wdml opcode
                        time:   [2.6808 ms 2.6963 ms 2.7130 ms]
block target estimation/wddv opcode
                        time:   [4.2766 ms 4.3064 ms 4.3368 ms]
block target estimation/wdmd opcode
                        time:   [3.5144 ms 3.5451 ms 3.5798 ms]
block target estimation/wdam opcode
                        time:   [3.7095 ms 3.7397 ms 3.7760 ms]
block target estimation/wdmm opcode
                        time:   [3.6330 ms 3.6595 ms 3.6915 ms]
block target estimation/wqcm opcode
                        time:   [2.4236 ms 2.4410 ms 2.4597 ms]
block target estimation/wqop opcode
                        time:   [2.7717 ms 2.7920 ms 2.8154 ms]
block target estimation/wqml opcode
                        time:   [2.9315 ms 2.9631 ms 2.9986 ms]
block target estimation/wqdv opcode
                        time:   [3.4322 ms 3.4572 ms 3.4846 ms]
block target estimation/wqmd opcode
                        time:   [4.4126 ms 4.4383 ms 4.4669 ms]
block target estimation/wqam opcode
                        time:   [3.8279 ms 3.8610 ms 3.8986 ms]
block target estimation/wqmm opcode
                        time:   [5.8005 ms 5.8658 ms 5.9469 ms]
  ```

---------

Co-authored-by: Brandon Vrooman <brandon.vrooman@gmail.com>
Co-authored-by: xgreenx <xgreenx9999@gmail.com>
GoldenPath1109 added a commit to GoldenPath1109/fuel-core that referenced this issue Sep 7, 2024
FuelLabs/fuel-core#1386

Results:
```
block target estimation/crypto/eck1 opcode
                        time:   [4.8418 ms 4.8650 ms 4.8882 ms]
block target estimation/crypto/ecr1 opcode
                        time:   [18.634 ms 18.791 ms 18.992 ms]
block target estimation/crypto/ed19 opcode
                        time:   [2.6451 ms 2.6698 ms 2.6963 ms]
```
s256:
```
block target estimation/crypto/s256 opcode 1
                        time:   [3.1244 ms 3.1409 ms 3.1575 ms]
Found 6 outliers among 100 measurements (6.00%)
  3 (3.00%) low mild
  3 (3.00%) high mild
block target estimation/crypto/s256 opcode 10
                        time:   [3.1082 ms 3.1299 ms 3.1515 ms]
Found 2 outliers among 100 measurements (2.00%)
  1 (1.00%) low mild
  1 (1.00%) high severe
block target estimation/crypto/s256 opcode 100
                        time:   [4.1553 ms 4.1781 ms 4.2026 ms]
block target estimation/crypto/s256 opcode 1000
                        time:   [8.3133 ms 8.3554 ms 8.3990 ms]
block target estimation/crypto/s256 opcode 10000
                        time:   [10.562 ms 10.611 ms 10.661 ms]
block target estimation/crypto/s256 opcode 19753
                        time:   [10.794 ms 10.847 ms 10.902 ms]
block target estimation/crypto/s256 opcode 29629
                        time:   [10.694 ms 10.773 ms 10.853 ms]
block target estimation/crypto/s256 opcode 44444
                        time:   [10.724 ms 10.795 ms 10.870 ms]
block target estimation/crypto/s256 opcode 66666
                        time:   [10.745 ms 10.810 ms 10.879 ms]
block target estimation/crypto/s256 opcode 100000
                        time:   [10.551 ms 10.608 ms 10.665 ms]
```

k256:
```
block target estimation/crypto/k256 opcode 1
                        time:   [4.0653 ms 4.0881 ms 4.1123 ms]
block target estimation/crypto/k256 opcode 10
                        time:   [4.0803 ms 4.1121 ms 4.1500 ms]
block target estimation/crypto/k256 opcode 100
                        time:   [3.9216 ms 3.9472 ms 3.9730 ms]
block target estimation/crypto/k256 opcode 1000
                        time:   [19.240 ms 19.610 ms 20.102 ms]
block target estimation/crypto/k256 opcode 10000
                        time:   [46.020 ms 46.250 ms 46.491 ms]
Benchmarking block target estimation/crypto/k256 opcode 19753: Warming up for 3.0000 s
Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 5.0s, or reduce sample count to 90.
block target estimation/crypto/k256 opcode 19753
                        time:   [51.484 ms 51.795 ms 52.121 ms]
Benchmarking block target estimation/crypto/k256 opcode 29629: Warming up for 3.0000 s
Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 5.1s, or reduce sample count to 90.
block target estimation/crypto/k256 opcode 29629
                        time:   [53.408 ms 54.647 ms 56.676 ms]
Benchmarking block target estimation/crypto/k256 opcode 44444: Warming up for 3.0000 s
Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 5.2s, or reduce sample count to 90.
block target estimation/crypto/k256 opcode 44444
                        time:   [54.142 ms 54.426 ms 54.716 ms]
Benchmarking block target estimation/crypto/k256 opcode 66666: Warming up for 3.0000 s
Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 5.3s, or reduce sample count to 90.
block target estimation/crypto/k256 opcode 66666
                        time:   [55.453 ms 55.730 ms 56.009 ms]
Benchmarking block target estimation/crypto/k256 opcode 100000: Warming up for 3.0000 s
Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 5.4s, or reduce sample count to 90.
block target estimation/crypto/k256 opcode 100000
                        time:   [54.617 ms 55.698 ms 57.215 ms]
```

---------

Co-authored-by: Green Baneling <XgreenX9999@gmail.com>
GoldenPath1109 added a commit to GoldenPath1109/fuel-core that referenced this issue Sep 7, 2024
FuelLabs/fuel-core#1386

```
block target estimation/flow/jmp opcode
                        time:   [1.9838 ms 1.9917 ms 2.0001 ms]
block target estimation/flow/ji opcode
                        time:   [1.6020 ms 1.6119 ms 1.6223 ms]
block target estimation/flow/jne opcode
                        time:   [2.2373 ms 2.2479 ms 2.2589 ms]
block target estimation/flow/jnei opcode
                        time:   [2.0990 ms 2.1085 ms 2.1176 ms]
block target estimation/flow/jnzi opcode
                        time:   [1.9626 ms 1.9776 ms 1.9930 ms]
block target estimation/flow/jmpb opcode
                        time:   [1.5740 ms 1.5819 ms 1.5904 ms]
block target estimation/flow/jmpf opcode
                        time:   [1.5385 ms 1.5455 ms 1.5529 ms]
block target estimation/flow/jnzb opcode true
                        time:   [1.6174 ms 1.6246 ms 1.6323 ms]
block target estimation/flow/jnzb opcode false
                        time:   [1.6395 ms 1.6482 ms 1.6568 ms]
block target estimation/flow/jnzf opcode true
                        time:   [1.5932 ms 1.5999 ms 1.6070 ms]
block target estimation/flow/jnzf opcode false
                        time:   [1.6132 ms 1.6227 ms 1.6333 ms]
block target estimation/flow/jne opcode
                        time:   [1.7591 ms 1.7703 ms 1.7822 ms]
block target estimation/flow/jnei opcode
                        time:   [1.5247 ms 1.5340 ms 1.5447 ms]
block target estimation/flow/jneb opcode not equal
                        time:   [1.6881 ms 1.6961 ms 1.7057 ms]
block target estimation/flow/jneb opcode equal
                        time:   [1.7255 ms 1.7362 ms 1.7481 ms]
block target estimation/flow/jnef opcode not equal
                        time:   [1.8018 ms 1.8132 ms 1.8259 ms]
block target estimation/flow/jnef opcode equal
                        time:   [1.7644 ms 1.7731 ms 1.7823 ms]
```

Not sure how to test `ret_script` or `ret_contract` with an infinite
loop 🤷

---------

Co-authored-by: Green Baneling <XgreenX9999@gmail.com>
GoldenPath1109 added a commit to GoldenPath1109/fuel-core that referenced this issue Sep 7, 2024
FuelLabs/fuel-core#1386

```
block target estimation/memory/aloc opcode
                        time:   [1.7153 ms 1.7225 ms 1.7304 ms]
block target estimation/memory/cfe opcode
                        time:   [1.6035 ms 1.6133 ms 1.6242 ms]
block target estimation/memory/cfei opcode
                        time:   [1.6067 ms 1.6161 ms 1.6261 ms]
block target estimation/memory/cfs opcode
                        time:   [1.5815 ms 1.5926 ms 1.6051 ms]
block target estimation/memory/cfsi opcode
                        time:   [1.6355 ms 1.6428 ms 1.6513 ms]
block target estimation/memory/lb opcode
                        time:   [1.7495 ms 1.7592 ms 1.7703 ms]
block target estimation/memory/lw opcode
                        time:   [1.7579 ms 1.7699 ms 1.7828 ms]
block target estimation/memory/mcl opcode 1
                        time:   [2.1388 ms 2.1553 ms 2.1799 ms]
block target estimation/memory/mcl opcode 10
                        time:   [2.1554 ms 2.1661 ms 2.1769 ms]
block target estimation/memory/mcl opcode 100
                        time:   [2.1288 ms 2.1415 ms 2.1547 ms]
block target estimation/memory/mcl opcode 1000
                        time:   [2.7993 ms 2.8172 ms 2.8354 ms]
block target estimation/memory/mcl opcode 10000
                        time:   [4.0290 ms 4.0541 ms 4.0791 ms]
block target estimation/memory/mcl opcode 19753
                        time:   [4.9775 ms 5.0025 ms 5.0281 ms]
block target estimation/memory/mcl opcode 29629
                        time:   [5.0122 ms 5.0411 ms 5.0712 ms]
block target estimation/memory/mcl opcode 44444
                        time:   [4.9450 ms 4.9724 ms 5.0005 ms]
block target estimation/memory/mcl opcode 66666
                        time:   [4.9388 ms 4.9640 ms 4.9899 ms]
block target estimation/memory/mcl opcode 100000
                        time:   [4.9764 ms 5.0030 ms 5.0310 ms]
block target estimation/memory/mcli opcode 1
                        time:   [2.0453 ms 2.0548 ms 2.0648 ms]
block target estimation/memory/mcli opcode 10
                        time:   [2.0375 ms 2.0480 ms 2.0585 ms]
block target estimation/memory/mcli opcode 100
                        time:   [2.0586 ms 2.0684 ms 2.0784 ms]
block target estimation/memory/mcli opcode 1000
                        time:   [2.7113 ms 2.7287 ms 2.7477 ms]
block target estimation/memory/mcli opcode 10000
                        time:   [3.9312 ms 3.9568 ms 3.9852 ms]
block target estimation/memory/mcli opcode 19753
                        time:   [4.9118 ms 4.9353 ms 4.9589 ms]
block target estimation/memory/mcli opcode 29629
                        time:   [4.9363 ms 4.9627 ms 4.9899 ms]
block target estimation/memory/mcli opcode 44444
                        time:   [4.8455 ms 4.8674 ms 4.8902 ms]
block target estimation/memory/mcli opcode 66666
                        time:   [4.8760 ms 4.9036 ms 4.9337 ms]
block target estimation/memory/mcli opcode 100000
                        time:   [4.9923 ms 5.0176 ms 5.0431 ms]
block target estimation/memory/mcp opcode 1
                        time:   [2.2783 ms 2.2892 ms 2.3000 ms]
block target estimation/memory/mcp opcode 10
                        time:   [2.2653 ms 2.2751 ms 2.2855 ms]
block target estimation/memory/mcp opcode 100
                        time:   [2.3478 ms 2.3608 ms 2.3740 ms]
block target estimation/memory/mcp opcode 1000
                        time:   [2.6947 ms 2.7140 ms 2.7390 ms]
block target estimation/memory/mcp opcode 10000
                        time:   [2.9727 ms 2.9851 ms 2.9976 ms]
block target estimation/memory/mcp opcode 19753
                        time:   [4.0645 ms 4.0992 ms 4.1429 ms]
block target estimation/memory/mcp opcode 29629
                        time:   [4.5143 ms 4.5370 ms 4.5602 ms]
block target estimation/memory/mcp opcode 44444
                        time:   [4.6528 ms 4.6742 ms 4.6967 ms]
block target estimation/memory/mcp opcode 66666
                        time:   [4.6505 ms 4.6744 ms 4.7010 ms]
block target estimation/memory/mcp opcode 100000
                        time:   [3.5548 ms 3.5713 ms 3.5883 ms]
block target estimation/memory/mcpi opcode 1
                        time:   [1.2296 ms 1.2352 ms 1.2405 ms]
block target estimation/memory/mcpi opcode 10
                        time:   [1.2135 ms 1.2188 ms 1.2240 ms]
block target estimation/memory/mcpi opcode 100
                        time:   [1.2760 ms 1.2816 ms 1.2873 ms]
block target estimation/memory/mcpi opcode 1000
                        time:   [1.4219 ms 1.4307 ms 1.4398 ms]
block target estimation/memory/meq opcode 1
                        time:   [1.9330 ms 1.9430 ms 1.9534 ms]
block target estimation/memory/meq opcode 10
                        time:   [1.9648 ms 1.9738 ms 1.9830 ms]
block target estimation/memory/meq opcode 100
                        time:   [1.9911 ms 2.0000 ms 2.0092 ms]
block target estimation/memory/meq opcode 1000
                        time:   [2.4182 ms 2.4293 ms 2.4405 ms]
block target estimation/memory/meq opcode 10000
                        time:   [3.3582 ms 3.3748 ms 3.3913 ms]
block target estimation/memory/meq opcode 19753
                        time:   [4.0710 ms 4.0870 ms 4.1029 ms]
block target estimation/memory/meq opcode 29629
                        time:   [4.0880 ms 4.1121 ms 4.1450 ms]
block target estimation/memory/meq opcode 44444
                        time:   [4.0922 ms 4.1076 ms 4.1230 ms]
block target estimation/memory/meq opcode 66666
                        time:   [4.1181 ms 4.1365 ms 4.1550 ms]
block target estimation/memory/meq opcode 100000
                        time:   [4.0834 ms 4.1013 ms 4.1201 ms]
block target estimation/memory/poph opcode
                        time:   [1.5574 ms 1.5661 ms 1.5745 ms]
block target estimation/memory/popl opcode
                        time:   [1.4805 ms 1.4882 ms 1.4964 ms]
block target estimation/memory/pshh opcode
                        time:   [3.6456 ms 3.6765 ms 3.7107 ms]
block target estimation/memory/pshl opcode
                        time:   [3.5495 ms 3.5675 ms 3.5862 ms]
block target estimation/memory/sb opcode
                        time:   [1.8727 ms 1.8832 ms 1.8946 ms]
block target estimation/memory/sw opcode
                        time:   [1.8648 ms 1.8746 ms 1.8846 ms]
```

---------

Co-authored-by: xgreenx <xgreenx9999@gmail.com>
GoldenPath1109 added a commit to GoldenPath1109/fuel-core that referenced this issue Sep 7, 2024
FuelLabs/fuel-core#1386
```
block target estimation/contract/bal contract
                        time:   [1.4691 ms 1.4723 ms 1.4758 ms]
block target estimation/contract/bal script
                        time:   [22.914 ms 22.954 ms 22.997 ms]
block target estimation/contract/bhei
                        time:   [2.5669 ms 2.5785 ms 2.5903 ms]
block target estimation/contract/bhsh
                        time:   [3.1837 ms 3.1990 ms 3.2147 ms]
block target estimation/contract/burn
                        time:   [108.90 ms 109.19 ms 109.48 ms]
block target estimation/contract/call 1
                        time:   [71.952 ms 72.085 ms 72.225 ms]
block target estimation/contract/call 10
                        time:   [69.186 ms 69.357 ms 69.526 ms]
block target estimation/contract/call 100
                        time:   [44.121 ms 44.225 ms 44.335 ms]
block target estimation/contract/call 1000
                        time:   [11.294 ms 11.318 ms 11.343 ms]
block target estimation/contract/call 10000
                        time:   [2.8902 ms 2.8962 ms 2.9024 ms]
block target estimation/contract/call 19753
                        time:   [2.4352 ms 2.4473 ms 2.4673 ms]
block target estimation/contract/call 29629
                        time:   [2.1797 ms 2.1898 ms 2.2043 ms]
block target estimation/contract/call 44444
                        time:   [2.1112 ms 2.1173 ms 2.1237 ms]
block target estimation/contract/call 66666
                        time:   [2.0530 ms 2.0610 ms 2.0691 ms]
block target estimation/contract/call 100000
                        time:   [1.9275 ms 1.9322 ms 1.9387 ms]
block target estimation/contract/cb
                        time:   [2.8728 ms 2.8836 ms 2.8946 ms]
block target estimation/contract/ccp 1
                        time:   [3.9833 ms 4.0033 ms 4.0309 ms]
block target estimation/contract/ccp 10
                        time:   [4.2070 ms 4.2235 ms 4.2427 ms]
block target estimation/contract/ccp 100
                        time:   [4.4203 ms 4.4391 ms 4.4574 ms]
block target estimation/contract/ccp 1000
                        time:   [3.7655 ms 3.7747 ms 3.7840 ms]
block target estimation/contract/ccp 10000
                        time:   [4.0406 ms 4.0589 ms 4.0775 ms]
block target estimation/contract/ccp 19753
                        time:   [3.5811 ms 3.5896 ms 3.5981 ms]
block target estimation/contract/ccp 29629
                        time:   [3.4583 ms 3.4839 ms 3.5158 ms]
block target estimation/contract/ccp 44444
                        time:   [3.4880 ms 3.4981 ms 3.5081 ms]
block target estimation/contract/ccp 66666
                        time:   [3.5190 ms 3.5329 ms 3.5514 ms]
block target estimation/contract/ccp 100000
                        time:   [3.4854 ms 3.4964 ms 3.5076 ms]
block target estimation/contract/croo
                        time:   [67.070 ms 67.253 ms 67.441 ms]
block target estimation/contract/csiz 1
                        time:   [3.1927 ms 3.2046 ms 3.2171 ms]
block target estimation/contract/csiz 10
                        time:   [3.3017 ms 3.3142 ms 3.3277 ms]
block target estimation/contract/csiz 100
                        time:   [3.4821 ms 3.4920 ms 3.5020 ms]
block target estimation/contract/csiz 1000
                        time:   [3.0014 ms 3.0087 ms 3.0167 ms]
block target estimation/contract/csiz 10000
                        time:   [3.2728 ms 3.2823 ms 3.2926 ms]
block target estimation/contract/csiz 19753
                        time:   [2.7656 ms 2.7722 ms 2.7794 ms]
block target estimation/contract/csiz 29629
                        time:   [2.6209 ms 2.6371 ms 2.6585 ms]
block target estimation/contract/csiz 44444
                        time:   [2.4669 ms 2.4798 ms 2.4940 ms]
block target estimation/contract/csiz 66666
                        time:   [2.4630 ms 2.4692 ms 2.4758 ms]
block target estimation/contract/csiz 100000
                        time:   [2.4514 ms 2.4616 ms 2.4762 ms]
block target estimation/contract/ldc 1
                        time:   [4.2252 ms 4.2377 ms 4.2506 ms]
block target estimation/contract/ldc 10
                        time:   [4.4222 ms 4.4362 ms 4.4503 ms]
block target estimation/contract/ldc 100
                        time:   [4.4831 ms 4.4936 ms 4.5046 ms]
block target estimation/contract/ldc 1000
                        time:   [4.2607 ms 4.2739 ms 4.2881 ms]
block target estimation/contract/ldc 10000
                        time:   [4.7586 ms 4.7841 ms 4.8157 ms]
block target estimation/contract/ldc 19753
                        time:   [4.6346 ms 4.6492 ms 4.6643 ms]
block target estimation/contract/ldc 29629
                        time:   [4.4694 ms 4.4880 ms 4.5071 ms]
block target estimation/contract/ldc 44444
                        time:   [4.4017 ms 4.4225 ms 4.4500 ms]
block target estimation/contract/ldc 66666
                        time:   [4.3336 ms 4.3425 ms 4.3516 ms]
block target estimation/contract/ldc 100000
                        time:   [4.4381 ms 4.4566 ms 4.4749 ms]
block target estimation/contract/log
                        time:   [10.256 ms 10.303 ms 10.350 ms]
block target estimation/contract/logd 1
                        time:   [4.1894 ms 4.2067 ms 4.2251 ms]
block target estimation/contract/logd 10
                        time:   [4.4084 ms 4.4381 ms 4.4722 ms]
block target estimation/contract/logd 100
                        time:   [5.3502 ms 5.4004 ms 5.4666 ms]
block target estimation/contract/logd 1000
                        time:   [13.050 ms 13.135 ms 13.223 ms]
block target estimation/contract/logd 10000
                        time:   [27.383 ms 27.628 ms 27.887 ms]
block target estimation/contract/logd 19753
                        time:   [29.407 ms 29.729 ms 30.055 ms]
block target estimation/contract/logd 29629
                        time:   [33.715 ms 44.027 ms 57.000 ms]
block target estimation/contract/logd 44444
                        time:   [33.105 ms 42.521 ms 54.599 ms]
block target estimation/contract/logd 66666
                        time:   [30.631 ms 30.949 ms 31.279 ms]
block target estimation/contract/logd 100000
                        time:   [30.155 ms 40.772 ms 54.713 ms]
block target estimation/contract/mint
                        time:   [98.285 ms 99.414 ms 100.69 ms]
block target estimation/contract/ret contract
                        time:   [73.189 ms 73.373 ms 73.580 ms]
block target estimation/contract/retd contract 1
                        time:   [65.356 ms 65.477 ms 65.600 ms]
block target estimation/contract/retd contract 10
                        time:   [66.407 ms 66.503 ms 66.604 ms]
block target estimation/contract/retd contract 100
                        time:   [66.665 ms 66.843 ms 67.024 ms]
block target estimation/contract/retd contract 1000
                        time:   [61.910 ms 62.100 ms 62.305 ms]
block target estimation/contract/retd contract 10000
                        time:   [49.114 ms 49.293 ms 49.474 ms]
block target estimation/contract/retd contract 19753
                        time:   [41.567 ms 41.799 ms 42.039 ms]
block target estimation/contract/retd contract 29629
                        time:   [40.203 ms 45.726 ms 56.567 ms]
block target estimation/contract/retd contract 44444
                        time:   [43.955 ms 58.338 ms 75.298 ms]
block target estimation/contract/retd contract 66666
                        time:   [36.076 ms 36.297 ms 36.520 ms]
block target estimation/contract/retd contract 100000
                        time:   [33.281 ms 33.629 ms 34.039 ms]
block target estimation/contract/smo 1
                        time:   [65.119 ms 65.588 ms 66.177 ms]
block target estimation/contract/smo 10
                        time:   [63.433 ms 63.720 ms 64.141 ms]
block target estimation/contract/smo 100
                        time:   [61.177 ms 61.465 ms 61.839 ms]
block target estimation/contract/smo 1000
                        time:   [59.890 ms 60.007 ms 60.134 ms]
block target estimation/contract/smo 10000
                        time:   [51.135 ms 51.444 ms 51.793 ms]
block target estimation/contract/smo 19753
                        time:   [45.648 ms 45.967 ms 46.336 ms]
block target estimation/contract/smo 29629
                        time:   [55.496 ms 69.138 ms 84.636 ms]
block target estimation/contract/smo 44444
                        time:   [50.462 ms 65.771 ms 83.605 ms]
block target estimation/contract/smo 66666
                        time:   [37.880 ms 38.247 ms 38.722 ms]
block target estimation/contract/smo 100000
                        time:   [33.433 ms 33.628 ms 33.823 ms]
block target estimation/contract/srw
                        time:   [73.681 ms 73.943 ms 74.347 ms]
block target estimation/contract/sww
                        time:   [111.88 ms 112.64 ms 113.41 ms]
block target estimation/contract/time
                        time:   [64.179 ms 64.539 ms 64.899 ms]
block target estimation/contract/tr
                        time:   [128.13 ms 128.49 ms 128.94 ms]
```

---------

Co-authored-by: Hannes Karppila <hannes.karppila@gmail.com>
Co-authored-by: xgreenx <xgreenx9999@gmail.com>
GoldenPath1109 added a commit to GoldenPath1109/fuel-core that referenced this issue Sep 7, 2024
FuelLabs/fuel-core#1386
```
block target estimation/other/flag
                        time:   [27.326 ms 27.458 ms 27.603 ms]
block target estimation/other/gm
                        time:   [7.7485 ms 7.7831 ms 7.8231 ms]
```

---------

Co-authored-by: Hannes Karppila <hannes.karppila@gmail.com>
Co-authored-by: xgreenx <xgreenx9999@gmail.com>
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

No branches or pull requests

3 participants