wswan:guide:optimization
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| wswan:guide:optimization [2025/12/31 12:49] – [Optimizing for speed] asie | wswan:guide:optimization [2025/12/31 12:50] (current) – [Optimizing for memory usage] asie | ||
|---|---|---|---|
| Line 17: | Line 17: | ||
| * For data stored in RAM, use the smallest type possible. | * For data stored in RAM, use the smallest type possible. | ||
| * Exception: For argument passing, there is little reason to prefer '' | * Exception: For argument passing, there is little reason to prefer '' | ||
| - | * By default, GCC allows function call arguments to accumulate on the stack, then pops them all at once. To reduce stack usage at the cost of a larger and slightly slower program, compile your code with '' | + | * By default, GCC allows function call arguments to accumulate on the stack, then pops them all at once. To reduce |
| ===== Optimizing assembly code ===== | ===== Optimizing assembly code ===== | ||
| Line 36: | Line 36: | ||
| There are also some additional tricks you can take advantage of: | There are also some additional tricks you can take advantage of: | ||
| - | * Avoid far calls between functions - branches are expensive, and far branches are significantly more expensive. If you're calling a far function from another far function in the same section, use '' | + | * Avoid far calls between functions - branches are expensive, and far branches are significantly more expensive. If you're calling a far function from another far function in the same section, use the '' |
| * Try word-aligning loop labels by prepending them with '' | * Try word-aligning loop labels by prepending them with '' | ||
wswan/guide/optimization.1767185378.txt.gz · Last modified: by asie
