SRL Archive - S.M.A.R.T. Questions and Answers.

SMART cpu usage


vanlacke

2014-09-14 19:09:20

I recently updated Simba & SMART to the latest version, and cpu usage is a large problem. The old SMART I was using (6.x), would use approx. 4-6% of the CPU(with slider lowered). However, the new build uses 11-13%. I should also note that with the old SMART I had a custom interface setup, and the SMART window was quite large, and now I am using oldschool setup, so much smaller, and yet CPU usage has doubled.

The slider for SMART used to have a large effect on usage, but now it has no effect whatsoever in terms of CPU usage. It does still lower frame rate.

Is there anything to be done?

riwu

2014-09-14 19:15:56

Is it SMART or the java that's taking more cpu?

the new SMART added only a few more features and functionality which shouldn't result in significant increase in resource usage i think?

Try running in browser and see if it's taking as much cpu

vanlacke

2014-09-14 19:37:14

It's javaw.exe

I just tested out my old build, and the slider has a clear effect on usage. I can get the usage down to 1-2% on idle which just isn't possible with the new build. So I am guessing the slider is somehow broken in the latest build.

Thanks for the reply

Olly

2014-09-14 20:02:53

The silders usage was changed some time ago iirc.

Brandon

2014-09-14 20:19:30

From: Olly
The silders usage was changed some time ago iirc.


Slider is only removed for plugins: https://github.com/BenLand100/SMART/blob/master/src/Client.java#L524

Plugins can still attach to the current SMART jvm and get the slider values and obey it (without going through SMART's plugin interface)..

Olly

2014-09-14 20:37:05

From: Brandon
Slider is only removed for plugins: https://github.com/BenLand100/SMART/blob/master/src/Client.java#L524

Plugins can still attach to the current SMART jvm and get the slider values and obey it (without going through SMART's plugin interface)..


That's true that it wont affect anything with a plugin active, but i'm still positive something about the slider was changed for safemode stuff.

Olly

2014-09-14 22:13:25

From: Olly
That's true that it wont affect anything with a plugin active, but i'm still positive something about the slider was changed for safemode stuff.


edit:

FPS bar no longer introduces lag in the client and only controls the rate at which SMART updates Simba's image buffer. The default should be fine for everyone, and as a side effect RS loads MUCH faster now.

vanlacke

2014-09-15 00:42:57

From: Olly
edit:


Exactly what I was looking for I think. I guess I have to take a peek inside the DLLs to learn more right? I've been trying to figure out how to open DLL files but it's been rough. Any insight?

And thanks so much for the help

EDIT: Well I opened up a DLL. No way I will be able to figure this out haha
EDIT2: Would it be possible to change the slider back to behaving like before? If so, any hints/tips on how I would go about doing that?

vanlacke

2014-09-19 01:00:46

Update:

I figured out how DLLs worked. I added a way to change the SMART window title from Simba. I'm still stumped on the slider though.. Been trying to figure out how to make it so it introduces lag like before.

Can anyone give some tips? I'll keep at it.

EDIT: I think it may be related to this line:
//canvas.setRefresh(500 / x - 5);

I un-commented it, but canvas doesn't have a function called setRefresh

riwu

2014-09-19 01:24:17

From: Mikemaladar
Update:

I figured out how DLLs worked. I added a way to change the SMART window title from Simba. I'm still stumped on the slider though.. Been trying to figure out how to make it so it introduces lag like before.

Can anyone give some tips? I'll keep at it.

EDIT: I think it may be related to this line:
//canvas.setRefresh(500 / x - 5);

I un-commented it, but canvas doesn't have a function called setRefresh

SmartSetRefresh()?
If you are editing smart source, the method is in Client.java.

vanlacke

2014-09-19 01:38:27

From: riwu
SmartSetRefresh()?
If you are editing smart source, the method is in Client.java.


The current SMART doesn't change the fps, or in other words introduce lag as Olly said. Right now it just changes the buffer transfer rate to simba which doesn't affect fps, hence no change in CPU usage.

Do you know how to make it introduce lag?

riwu

2014-09-19 05:09:01

From: Mikemaladar
The current SMART doesn't change the fps, or in other words introduce lag as Olly said. Right now it just changes the buffer transfer rate to simba which doesn't affect fps, hence no change in CPU usage.

Do you know how to make it introduce lag?

in the Canvas class, add
if (buffer != null) try { Thread.sleep(refresh); } catch (Exception e) { }
to the getGraphics() method. ^ change refresh to how long u want it to sleep before getting the graphics.

But a lower fps will mean a drop in performance for most RS activities?

vanlacke

2014-09-19 16:24:22

From: riwu
in the Canvas class, add
if (buffer != null) try { Thread.sleep(refresh); } catch (Exception e) { }
to the getGraphics() method. ^ change refresh to how long u want it to sleep before getting the graphics.

But a lower fps will mean a drop in performance for most RS activities?


That was the missing link! I had to add that line, as well as do a few more changes including uncommenting the line I mentioned previously. CPU usage has been cut down by 50%. Thanks so much :)

Also, as a player lower FPS would bother me while playing a game, but my scripts don't really care

Comodo

2014-09-21 12:30:01

From: Mikemaladar
That was the missing link! I had to add that line, as well as do a few more changes including uncommenting the line I mentioned previously. CPU usage has been cut down by 50%. Thanks so much :)

Also, as a player lower FPS would bother me while playing a game, but my scripts don't really care


Do you maybe have a skype you could pm me? I want to ask you a few questions.