dss-extensions / dss-extensions/dss_matlab
COM vs dss_matlab speed comparison for setting loads and getting currents; handle classes are slow
- Lingua principale
- MATLAB
- Stelle
- 12
- Fork
- 2
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
here is the speed comparison I promised in DSS Disussion Forum https://sourceforge.net/p/electricdss/discussion/861976/thread/a096cdeed4/?limit=100#a3e1/261b
### Summary
setting loads and getting currents is currently (November 2024) much slower (about 7 times) using altDSS compared to COM-Interface.
The main reason is: Matlab handle classes still have huge overhead.
Workaround: calling libs directly. Then altDSS is only about 1.5 times slower than COM-Interface.
Also: 2021b and 2024 b are faster than old 2019b (maybe something like 20 %). But handle classes are still too slow!
Conclusion: handle classes are not a good option. There might be a better way to emulate COM-Interface.
### speed comparision of altDSS and COM and 2019b vs 2024b
this is on windows 10 VM with newest DSS (100_2, temporary trick to install [Regsvr32 "C:\Program Files\OpenDSS\x64\OpenDSSEngine.DLL"](https://sourceforge.net/p/electricdss/discussion/861977/thread/d97878c8f4/?limit=25))

### Code used for comparison
I attached a grid file with lines and loads and a .m Matlab file. It should be executable.
To execute:
1. rename .txt of Matlab file to .m
3. install DSS (https://sourceforge.net/p/electricdss/discussion/861977/thread/d97878c8f4/?limit=25 workaround might be needed)
4. Download dss_matlab
2. modifiy Base.m of dss_matlab as described in the attached Matlab file
5. add necessary to MATLAB path
6. Check code for safety
7. Run
[speed_of_altDSS_vs_COM_m_file.txt](https://github.com/user-attachments/files/17630605/speed_of_altDSS_vs_COM_m_file.txt)
[LV_grid.txt](https://github.com/user-attachments/files/17630606/LV_grid.txt)
### Suggestion for getAllLineCurrents makro in the code as Matlab Code
of course this must be implemented in C++ to have a speed benefit.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.