Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

R1981 patch: Serial monitor affects simulation speed.

2 posters

Go down  Message [Page 1 of 1]

royqh1979



When I'm testing UART with 2 8051 mcu, after running for some time, the speed of simulation would drop significantly.

I found that when a UART's serial monitor is opened, it will keep appending new data to its outpanels, no matter if it's closed or not. I think it's a bug.

In the following patch, serial monitor's printIn()/printOut() will check if it's visible(closed) before appending new data to outpanels.
Attachments
R1981 patch: Serial monitor affects simulation speed. Attachmentslow.zip
You don't have permission to download attachments.
(1 Kb) Downloaded 1 times

arcachofo

arcachofo

Yes, that can be an issue, specially if there is a lot of data.

By now I disabled the update while the Serial Monitor is closed, but it will print all the data sent/received.
This fixes the hi cpu usage while it's closed.

But I see 2 issues here to discuss:

1- What to do when Serial Monitor is closed?
a) Clear the messages and don't print until open again.
b) Keep it running (but not updating).

2- How many characters should be the maximum.
The main problem is that now it keeps 100k characters.
Should it be reduced? if so to which size?
Should it be configurable?

royqh1979



arcachofo wrote:
1- What to do when Serial Monitor is closed?
   a) Clear the messages and don't print until open again.
   b) Keep it running (but not updating).
en...The problem my encountered is that the monitor was opened by default(saved in circuit). After circuit was loaded, I closed it and thought it won't work any more. I searched a lot for the reason until I realized that m_monitor is not NULL...

So at least for me, close the monitor should mean stop monitoring.

arcachofo wrote:
2- How many characters should be the maximum.
  The main problem is that now it keeps 100k characters.
   Should it be reduced? if so to which size?
   Should it be configurable?
Not sure... I've just started to learn mcu programming and have no idea how UART is used in reality.

But it seems that we don't need to syntax highlight the data. And we can made the text editor readonly and just append to it (no need to move the caret), to improve the performance...

royqh1979



royqh1979 wrote:
arcachofo wrote:
1- What to do when Serial Monitor is closed?
   a) Clear the messages and don't print until open again.
   b) Keep it running (but not updating).
en...The problem my encountered is that the monitor was opened by default(saved in circuit). After circuit was loaded,  I closed it  and thought it won't work any more. I searched a lot for the reason until I realized that m_monitor is not NULL...

So at least for me, close the monitor should mean stop monitoring.

The point is that, there's no obvious way to stop the monitor. In my case, the only way is close the monitor, save circuit, and reload it.

So I think if close the monitor don't stop monitoring, there should be a button or menu item to stop it.

arcachofo

arcachofo

The problem my encountered is that the monitor was opened by default(saved in circuit).
If you save the circuit with Serial Monitor open it will open when you open the circuit next time.
You can close the monitor and save the circuit to prevent it to open next time.


But it seems that we don't need to syntax highlight the data. And we can made the text editor readonly and just append to it (no need to move the caret), to improve the performance...
Yes ther are some things that could be done to improve performance. I will have a look.

In any case performance is proportional (inverse) to the amount of characters in the panel.


The point is that, there's no obvious way to stop the monitor. In my case, the only way is close the monitor, save circuit, and reload it.

So I think if close the monitor don't stop monitoring, there should be a button or menu item to stop it.
Yes, that is a good point.
A button to stop/start logging could be a good solution.

royqh1979



arcachofo wrote:
The point is that, there's no obvious way to stop the monitor. In my case, the only way is close the monitor, save circuit, and reload it.

So I think if close the monitor don't stop monitoring, there should be a button or menu item to stop it.
Yes, that is a good point.
A button to stop/start logging could be a good solution.

There are more :
-  There's no way to indicate user the closed monitor is still monitoring. It's hard for user to find the reason why the simulation slows down. So If a user want the closed monitor to continue monitoring, he should tell simulide to do that EXPLICITLY.

-  Since open  auto start monitoring, it's natural to think that close the monitor would auto stop it. If by default stop need a button to manually do that, I think start should be manual, too.

arcachofo

arcachofo

- There's no way to indicate user the closed monitor is still monitoring. So it's hard for user to find the reason why the simulation slows down.
Simulation slowdown when monitor is closed is already solved.

- Since open auto start monitoring, it's natural to think that close the monitor would auto stop it. If by default stop need a button to manually do that, I think start should be manual, too.
I think the default should be as it is now: once opened the monitor start to work and keeps working unless you push the stop button.
The same stop button could be use to start it again.

arcachofo

arcachofo

I added a "Pause" button at Rev 1986.
Maybe this is enough?

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum