|
1 |
| -# Technical background / tweaking performance and resource usage |
| 1 | +# Technical details and performance tweaks |
| 2 | + |
| 3 | +## RAM vs. Flash |
| 4 | + |
| 5 | +On some MCU-architectures, RAM and FLASH reside in two logically distinct address spaces. This implies that regular const char* strings |
| 6 | +need to be copied into RAM address space, even if they are fully static. EmbAJAX needs many string constants, and is therefore quite affected |
| 7 | +by this problem. |
| 8 | + |
| 9 | +The Arduino F() macro helps to work around this (further reading, there), but does incur a small performance (and code size) penalty, which can |
| 10 | +be avoided if a) RAM usage is not an issue, or b) the MCU uses a unified address space. |
| 11 | + |
| 12 | +By default, EmbAJAX tries to detect case b), and will disable use of F() strings, then. The USE_PROGMEM_STRINGS define near the top of EmbAJAX.h |
| 13 | +allows you to tweak this for special needs. |
| 14 | + |
| 15 | +Note that at the time of this writing, there is no distinct support for keeping ```EmbAJAXStatic``` blocks in PROGMEM. Pull requests are welcome. |
2 | 16 |
|
3 | 17 | ## Latency vs. network traffic vs. performance
|
4 | 18 |
|
@@ -37,20 +51,6 @@ To avoid sending all states of all controls on each request from each client, th
|
37 | 51 | sent to any client. The client pings back its current revision number on each request, so only real changes have to be forwarded. This is particularly
|
38 | 52 | important where several clients are accessing the same page, and need to be kept in sync.
|
39 | 53 |
|
40 |
| -## RAM vs. Flash |
41 |
| - |
42 |
| -On some MCU-architectures, RAM and FLASH reside in two logically distinct address spaces. This implies that regular const char* strings |
43 |
| -need to be copied into RAM address space, even if they are fully static. EmbAJAX needs many string constants, and is therefore quite affected |
44 |
| -by this problem. |
45 |
| - |
46 |
| -The Arduino F() macro helps to work around this (further reading, there), but does incur a small performance (and code size) penalty, which can |
47 |
| -be avoided if a) RAM usage is not an issue, or b) the MCU uses a unified address space. |
48 |
| - |
49 |
| -By default, EmbAJAX tries to detect case b), and will disable use of F() strings, then. The USE_PROGMEM_STRINGS define near the top of EmbAJAX.h |
50 |
| -allows you to tweak this for special needs. |
51 |
| - |
52 |
| -Note that at the time of this writing, there is no distinct support for keeping ```EmbAJAXStatic``` blocks in PROGMEM. Pull requests are welcome. |
53 |
| - |
54 | 54 | ## Some further implementation notes
|
55 | 55 |
|
56 | 56 | Concurrent access by an arbitrary number of separate clients is the main reason behind going with AJAX, instead of WebSockets, even if the
|
|
0 commit comments