finaltidus said:
When running a script with mafia normally I use at most ~15% CPU, but when I have the gCLI open I always use 25%
Sorry that I brought up an OBVIOUS issue that mafia hogs cpu when it shouldn't
When the gCLI is not open, KoLmafia is making requests of KoL - and doing whatever Java does to wait until the response come in.
When the gCLI is open, KoLmafia is also running a thread waiting for input from the terminal. Using Java calls. Doing what? Polling? Who knows? Not I.
I am completely unsurprised that KoLmafia uses more CPU when the gCLI is open than when it is not.
That it goes from 15% of your CPU to 25% of your CPU is higher than I would have guessed.
But, when you characterize "using 25% of your CPU" as "hogging" the CPU, I raise my eyebrows.
Really?
A program running a GUI (which has event polling) and doing net access (and polling the network and occasionally processing responses) and also with an open command line (polling the keyboard) and it's using 25% of the CPU?
I would not be surprised if we could work to cut back on CPU usage for all those threads, but is 25% really a problem to you? Enough to characterize the program as "hogging" the CPU?
You have a CS degree? Congratulations! I will welcome your code analysis/profiling/whatever to point out exactly where we are "wasting" CPU. I suggest you focus on that "Chat Buffer" code which manages the gCLI window.
However, I believe the other devs have politely informed you that we don't think it's worth spending OUR (unpaid volunteer) time to work on that issue.
If you feel it IS worth YOUR (unpaid volunteer) time to reduce that 25% CPU footprint to something you would not characterize as "hogging", by all means - spend that time, submit a patch, and I, personally, will look at at.
Thank you!