Conversation
|
@KobusVanRooyen, made an initial commit to this issue, where there is a slight improvement (~0.3s faster per call). I would still want to know if it could be sped up (exploratory), but I don't want to overdo it, so I would like to hear the requirements/what you think as well. |
@gopalangj 0.3s faster, nice. What is the ~percentage improvement? What was the original time [s] per call? |
…zation/mesido into 412-efficient-influxdatabase-connections Pulling main into the branch before making any changes
…ifferent threads trying to access same object information that could lead to code corruption
|
@gopalangj review completed. |
|
@KobusVanRooyen Pushed changes after discussion |
gopalangj
left a comment
There was a problem hiding this comment.
Submitting "pending" comments. They are outdated anyway, but for the sake of completion
|
|
||
| conn_settings = ConnectionSettings( | ||
| host=profile.host, | ||
| # host=profile.host, |
There was a problem hiding this comment.
profile.host starts the hyperlink with "https:/", whereas profile_host starts without it. It did seem okay to query and make connections without the "https:/". This particular change made coding other parts easy, which is why I did it, but I don't want to break the code. So I'd like to know about this as well
There was a problem hiding this comment.
I do see that the conn_settings are used only in this part of the code (within this function), which is a local variable. So essentially it should not break the other parts of the code
| f" is not available in the host.", | ||
| ) | ||
| potential_error_to_error(NetworkErrors.HEAT_NETWORK_ERRORS) | ||
| with self._lock: |
There was a problem hiding this comment.
This thread lock is implemented so that different threads don't try to access the same information (here the DB Manager object), which could lead to the program crashing. Thus, this will allow the threads to access the data one-at a time.
This adds a very small overhead, but will be beneficial and safe for large-problems
No description provided.