Remove Win32 console output overhead#455
Conversation
|
Improving efficiency is a good idea, but will hardly matter in a running simulator. Measurements would justify it. Meanwhile, either the steering committee has changed the project commit message goals, or you forgot to format the commit message identifying the affected component (or simulator). The original commit message rules were specifically recommended by one of the steering committee members. Additionally, when I was the gateway for commits, the convention I had folks follow was:
Otherwise this code in this PR is OK with me. |
|
@markpizz: While I'm at it, other than using @pkoning2: This is the equivalent of calling |
I agree totally and never said anything to the contrary.
I agree totally and never said anything to the contrary. Since you:
I suggested it be adopted with consideration of my other points about:
I also suggested that the net result of this change would probably not be measurable in a running simulator.
AGAIN, I said it should be adopted. My suspicion is that since ALL of the simh the simulators do at least 99% of their work in code not explicitly part of the SCP framework, this very real optimization will be hard to see a difference to those simulators. Feel free to provide measurements of a complete simulator run (maybe one of the existing build tests) before and after the adoption to get everyone excited about the change. AGAIN, I said it should be adopted. |
So, you didn't say "Improving efficiency is a good idea, but will hardly matter in a running simulator. Measurements would justify it."? |
What are you talking about? I said exactly that in my first comment on this PR. By saying that I DIDN'T mean that the change was bad, but that measurements would justify the claim that it would make a difference to a simulator user. Sorry if that caused confusion. |
The overhead of |
Don't repeatedly call GetConsoleMode() on Win32 each time sim_console_write() is called. Use an output function pointer to invoke WriteConsoleA (console output) or WriteFile (output is not a console). The console output destination doesn't change during the lifetime of the simulator, so avoid extraneous overhead for each character output (sometimes strings, but mostly characters.)
Don't repeatedly call GetConsoleMode() on Win32 each time sim_console_write() is called.
Use an output function pointer to invoke WriteConsoleA (console output) or WriteFile (output is not a console). The console output destination doesn't change during the lifetime of the simulator, so avoid extraneous overhead for each character output (sometimes strings, but mostly characters.)