Skip to content

Commit ec6d586

Browse files
committed
docs(examples): update comments for cu optimization in manual buy script
1 parent 3f20649 commit ec6d586

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

learning-examples/manual_buy_cu_optimized.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
99
Key difference from manual_buy.py:
1010
- Adds set_loaded_accounts_data_size_limit(512_000) before other instructions
11+
12+
NOTE: The CU savings from this optimization are NOT visible in transaction "consumed CU"
13+
metrics, which only show execution CU. The 16k CU loaded accounts overhead is counted
14+
separately for transaction priority/cost calculation. This makes the real impact hard
15+
to measure directly, but it improves priority.
16+
17+
Reference: https://www.anza.xyz/blog/cu-optimization-with-setloadedaccountsdatasizelimit
1118
"""
1219

1320
import asyncio

0 commit comments

Comments
 (0)