> For the complete documentation index, see [llms.txt](https://apps.sanomads.com/slice-n-save/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apps.sanomads.com/slice-n-save/overview/limitations-and-constraints.md).

# Limitations & constraints

There are some resource limitations & constraints from Shopify for the use of discount Shopify functions. In Slice 'n Save, different categories have different discount limitations within the app. You can create up-to 25 Automatic discounts at max.

### <mark style="color:yellow;">1. Amount off products - Basic</mark>

| Items | Conditions | Criteria | Counts    | Input   | Output  |
| ----- | ---------- | -------- | --------- | ------- | ------- |
| 1     | 3          | 3        | 2.9973 M  | 2.63 kB | 0.28 kB |
| 5     | 3          | 3        | 4.5599 M  | 3.52 kB | 0.84 kB |
| 10    | 3          | 3        | 6.9614 M  | 4.67 kB | 1.55 kB |
| 16    | 3          | 3        | 10.4966 M | 6.09 kB | 2.41 kB |

### <mark style="color:yellow;">2. Amount off products - Basic</mark>

| Items | Conditions | Criteria | Counts    | Input    | Output  |
| ----- | ---------- | -------- | --------- | -------- | ------- |
| 1     | 3          | 3        | 3.1187 M  | 2.63 kB  | 0.28 kB |
| 5     | 3          | 3        | 4.8460 M  | 3.67 kB  | 0.84 kB |
| 10    | 3          | 3        | 7.4354 M  | 0.84 kB  | 1.55 kB |
| 15    | 3          | 3        | 10.4798 M | 6.29 kB  | 2.27 kB |
| 1     | 6          | 5        | 3.7736 M  | 3.50 kB  | 0.37 kB |
| 5     | 6          | 5        | 6.7475 M  | 4.54 kB  | 1.31 kB |
| 9     | 6          | 5        | 10.5827 M | 5.58 kB  | 2.25 kB |
| 35    | 1          | 1        | 10.9313 M | 10.87 kB | 1.81 kB |

### <mark style="color:yellow;">3. Amount off order - Basic</mark>

| Items | Conditions | Criteria | Counts   | Input    | Output  |
| ----- | ---------- | -------- | -------- | -------- | ------- |
| 1     | 4          | N/A      | 2.1336 M | 2.30 kB  | 0.20 kB |
| 15    | 4          | N/A      | 3.3181 M | 5.59 kB  | 0.20 kB |
| 30    | 4          | N/A      | 4.5777 M | 9.14 kB  | 0.20 kB |
| 45    | 4          | N/A      | 5.8114 M | 12.68 kB | 0.20 kB |
| 1     | 7          | N/A      | 2.4391 M | 2.82 kB  | 0.20 kB |
| 15    | 7          | N/A      | 3.6213 M | 6.11 kB  | 0.20 kB |
| 30    | 7          | N/A      | 4.8799 M | 9.65 kB  | 0.20 kB |

### <mark style="color:yellow;">4. Amount off order - Advanced</mark>

| Items | Conditions | Criteria | Counts   | Input    | Output  |
| ----- | ---------- | -------- | -------- | -------- | ------- |
| 1     | 4          | N/A      | 2.1452 M | 2.27 kB  | 0.20 kB |
| 15    | 4          | N/A      | 3.4848 M | 5.93 kB  | 0.20 kB |
| 30    | 4          | N/A      | 4.9076 M | 9.86 kB  | 0.20 kB |
| 45    | 4          | N/A      | 6.3122 M | 13.79 kB | 0.20 kB |
| 1     | 7          | N/A      | 2.4231 M | 2.80 kB  | 0.20 kB |
| 15    | 7          | N/A      | 3.7667 M | 6.46 kB  | 0.20 kB |
| 30    | 7          | N/A      | 5.1918 M | 10.39 kB | 0.20 kB |

### <mark style="color:yellow;">5. Amount off Shipping - Basic</mark>

| Items | Conditions | Criteria | Counts   | Input    | Output  |
| ----- | ---------- | -------- | -------- | -------- | ------- |
| 1     | 4          | N/A      | 2.4555 M | 3.78 kB  | 0.20 kB |
| 15    | 4          | N/A      | 2.9070 M | 5.94 kB  | 0.20 kB |
| 30    | 4          | N/A      | 4.9108 M | 10.65 kB | 0.20 kB |
| 1     | 7          | N/A      | 2.7778 M | 4.30 kB  | 0.20 kB |
| 15    | 7          | N/A      | 3.9491 M | 7.61 kB  | 0.20 kB |
| 30    | 7          | N/A      | 5.2144 M | 11.16 kB | 0.20 kB |

### <mark style="color:yellow;">6. Amount off Shipping - Advanced</mark>

| Items | Conditions | Criteria | Counts   | Input    | Output  |
| ----- | ---------- | -------- | -------- | -------- | ------- |
| 1     | 4          | N/A      | 2.4725 M | 3.74 kB  | 0.20 kB |
| 15    | 4          | N/A      | 3.8141 M | 7.40 kB  | 0.20 kB |
| 30    | 4          | N/A      | 5.2428 M | 11.33 kB | 0.20 kB |
| 1     | 7          | N/A      | 2.7610 M | 4.26 kB  | 0.20 kB |
| 15    | 7          | N/A      | 4.0823 M | 7.91 kB  | 0.20 kB |
| 30    | 7          | N/A      | 5.5090 M | 11.84 kB | 0.20 kB |

### <mark style="color:yellow;">7. Tiered discounts</mark>

| Items | Conditions | Criteria | Counts    | Input   | Output  |
| ----- | ---------- | -------- | --------- | ------- | ------- |
| 1     | 1          | 2        | 3.3862 M  | 3.52 kB | 0.87 kB |
| 15    | 1          | 2        | 8.7318 M  | 7.18 kB | 2.81 kB |
| 19    | 1          | 2        | 10.7333 M | 8.22 kB | 3.36 kB |

### <mark style="color:yellow;">8. Quantity break discounts:</mark>

| Items | Conditions | Criteria | Counts    | Input    | Output  |
| ----- | ---------- | -------- | --------- | -------- | ------- |
| 1     | 2          | 1        | 3.1627 M  | 3.47 kB  | 0.60 kB |
| 15    | 2          | 1        | 6.6208 M  | 7.14 kB  | 1.89 kB |
| 28    | 2          | 1        | 10.8969 M | 10.54 kB | 3.08 kB |
| 1     | 2          | 2        | 3.2942 M  | 3.64 kB  | 0.60 kB |
| 21    | 2          | 2        | 10.8841 M | 8.61 kB  | 2.35 kB |

### <mark style="color:yellow;">9. BOGO discounts:</mark>

| Items | Conditions | Criteria | Counts   | Input    | Output  |
| ----- | ---------- | -------- | -------- | -------- | ------- |
| 8     | 2          | 1        | 5.2674 M | 8.97 kB  | 0.60 kB |
| 8     | 2          | 2        | 6.2455 M | 9.37 kB  | 1.89 kB |
| 10    | 3          | 3        | 9.2320 M | 12.40 kB | 0.73 kB |

## <mark style="color:yellow;">Shopify Function's limitations & considerations</mark>

#### <mark style="color:yellow;">1. Fixed Resources:</mark>

The following fixed resource limits apply to all functions:

| Resource                                           | Limit            |
| -------------------------------------------------- | ---------------- |
| <ol><li>Compiled binary size</li></ol>             | 256 kB           |
| <ol start="2"><li>Runtime linear memory</li></ol>  | 10,000 kB        |
| <ol start="3"><li>Runtime stack memory</li></ol>   | 512 kB           |
| <ol start="4"><li>Logs written to STDERR</li></ol> | 1 kB (truncated) |

#### <mark style="color:yellow;">2. Dynamic Resources:</mark>

The following dynamic resource limits apply to all functions:

| Resource                                      | Limit (up to 200 line items) |
| --------------------------------------------- | ---------------------------- |
| <ol><li>Execution instruction count</li></ol> | 11 million instructions      |
| <ol start="2"><li>Function input</li></ol>    | 64 kB                        |
| <ol start="3"><li>Function output</li></ol>   | 20 kB                        |

<mark style="color:yellow;">**Note:**</mark> For carts with more than 200 line items, these values will scale proportionally as the number of cart lines increases.
