performance_optimization
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
performance_optimization [2021/01/16 10:53] – [General rules for optimizing your projects] emozolyak | performance_optimization [2023/05/03 08:41] – [General rules for optimizing your projects] emozolyak | ||
---|---|---|---|
Line 5: | Line 5: | ||
Schematically, | Schematically, | ||
- | {{ :: | + | {{ network: |
The kernel works cyclically. This means that all actions are performed sequentially. If delays occur at some stage, this affects the execution time of the entire cycle. | The kernel works cyclically. This means that all actions are performed sequentially. If delays occur at some stage, this affects the execution time of the entire cycle. | ||
Line 123: | Line 123: | ||
-Use screens wherever is possible for visualisation, | -Use screens wherever is possible for visualisation, | ||
-Avoid using bulky dashboards (too rich in elements, having heavy-weight pictures etc. ), " | -Avoid using bulky dashboards (too rich in elements, having heavy-weight pictures etc. ), " | ||
+ | -Set appropriate screen refresh time. | ||
+ | -use templates for dashboards, alerts and others | ||
+ | -for Gantt diagrams, don't set too big time range | ||
+ | |||
=== Scripting === | === Scripting === | ||
- | -Avoid using many scripts. The better way is using a few big scripts or scripts with libraries | + | -Avoid using many scripts. The better way is using a few big scripts or scripts with libraries |
-Run scripts upon changing value, minimize the number of scripts, running in each scan. | -Run scripts upon changing value, minimize the number of scripts, running in each scan. | ||
- | -Minimize " | + | -Minimize " |
<code lua> | <code lua> | ||
Line 132: | Line 136: | ||
local cur_value = R(reg) | local cur_value = R(reg) | ||
| | ||
- | if (not cur_value) or (cur_value == new_value) then | + | if (not cur_value) or (not new_value) or (cur_value == new_value) then |
- | return | + | return |
else | else | ||
WriteReg(reg, | WriteReg(reg, | ||
Line 140: | Line 144: | ||
</ | </ | ||
- | -. | + | === Connections === |
- | -Group register to read on external device and use group reading. | + | -Use group registers feature |
- | -Set appropriate timeout and tries in external connections | + | -Set appropriate timeout and tries in external connections |
- | -Organize and set different reading | + | -Organize and set different reading |
- | | + | -For mulitple external devices, you can use " |
- | -Set appropriate screen refresh time. | + | |
- | -Keep the number of open tabs minimal for the current | + | === Project editing === |
- | -During development, | + | |
- | -Avoid making | + | -Keep the number of open tabs in browser |
- | -Minimize logging many registers to DB, set appropriate log speed for them. | + | -Avoid making |
+ | |||
+ | === Track Load Average parameter === | ||
+ | There is a metric register in the internal register showing mean number of the processes in the queue relative to the running process. There are 1, 5, 15 minutes mean paratemer. In a steady state, you 15 minutes metric should be below 1. | ||
+ | |||
+ | === Optimize log=== | ||
+ | -Minimize logging many registers to DB, set appropriate log speed for them. When setting 'use data from log' for the graphs, make sure you limit the log amount with the setting. | ||
+ | |||
+ | === Don't forget to remove debug log === | ||
+ | Printing to communication log, especially TRACE function, may load up your system significantly. Don't forget to switch off unnecessary logging and to disable debug printing after finishig debug process. | ||
performance_optimization.txt · Last modified: 2023/05/03 08:54 by emozolyak