Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 01:28
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (kzhao, AndrewAMD, bigsmack), 824 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 3 of 5 1 2 3 4 5
Re: minimize cpu usage [Re: Wjbender] #430936
10/06/13 11:31
10/06/13 11:31
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline OP
Expert
Kartoffel  Offline OP
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
@Uhrwerk: sorry, I didn't see you replied...

I'm using an Intel i7 (4770k) with 8 threads (4 cores) running at 3.5ghz each.
My graphics card is an AMD Radeon HD 7850 (in case that's important, too).

this application uses ~8-10% (64-80% of one core or 2.24-2.8ghz):
Code:
#include <acknex.h>

void main()
{
	wait(1);
	fps_max = 60;
	
	video_set(sys_metrics(0) * .5, sys_metrics(1) * .5, 0, 2);
}



POTATO-MAN saves the day! - Random
Re: minimize cpu usage [Re: Wjbender] #430938
10/06/13 12:03
10/06/13 12:03
Joined: Sep 2009
Posts: 993
Budapest
Aku_Aku Offline
User
Aku_Aku  Offline
User

Joined: Sep 2009
Posts: 993
Budapest
Just a side note.
You should not compare lite-c to c++.
The first one is a script language, it drives an engine behind the script.
The second one does not drive an engine, it is simple a language.

Re: minimize cpu usage [Re: Aku_Aku] #430939
10/06/13 12:17
10/06/13 12:17
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
On a note beside that note , lite-c sucks
no matter what you say on its behalf
it sucks they tried to get close to
the real language with it which would
be okay for any newcomer but it still
sucks to me even the c++ of gamestudio
sucks , lite-c is not exactly much of a scrypting language , it looks like a chopped down c language
..half measures .. So who is comparing here ? Me or acknex


Compulsive compiler
Re: minimize cpu usage [Re: Wjbender] #430940
10/06/13 12:29
10/06/13 12:29
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Maybe it's not the language that sucks but the one who tries to use it.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: minimize cpu usage [Re: Superku] #430941
10/06/13 14:15
10/06/13 14:15
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Wbjender is right, kindaish, I mean, Lite-C really isn't that good. Though that's pretty much all I'm agreeing on with him, and don't get me started on the Apple and Oranges comparison between Lite-C and C++.

Anyhow, the reason your CPU activity is so high, despite gamestudio not doing anything, is most likely because it is busy looping it's run loop. You see, there are cases where it makes sense to do only work in bursts and give CPU time back otherwise, not only for performance but also battery uses, but it doesn't make sense for Gamestudio.

If you limit the FPS to 60, it makes sense to only dispatch a run through the run loop every 16 milliseconds, that's what you expect after all. It doesn't make sense to give the CPU time back though, busy looping for the 16 milliseconds to pass would be the wiser decision. The reason for this is that putting your program to sleep relies on the scheduler to wake the program up again in time, which is definitely not going to happen. That's fine for normal applications, but not for applications where milliseconds make a difference. Forcing a reschedule marks your application as nice, and will implicitly lower your priority within the scheduler. The contract is simple: You don't use everything, you don't need everything, so you are less likely to get scheduled. Again, not desirable in an application where time is critical. You want to burn CPU cycles that you don't use, simply to look active and maintain a high priority, stupid jittering just because the game got suddenly more CPU intensive is the least thing you want.

tl;dr: Don't use gamestudio for things it wasn't made.

Edit: And Kartoffel, please bring back the vibrant colours to your music player. The ones of your last screen without the saturation look pretty meh if anyone wants to know my opinion.

Last edited by JustSid; 10/06/13 14:27.

Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: minimize cpu usage [Re: Superku] #430942
10/06/13 14:19
10/06/13 14:19
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
Luckily i dont do sissyfit very well but what i do Do well is the following , **gone**


Compulsive compiler
Re: minimize cpu usage [Re: Wjbender] #430943
10/06/13 14:51
10/06/13 14:51
Joined: Sep 2009
Posts: 993
Budapest
Aku_Aku Offline
User
Aku_Aku  Offline
User

Joined: Sep 2009
Posts: 993
Budapest
That is not enough, when you wrote
Quote:
lite-c sucks

You should give evidence of that.
Now i am curious, why is so bad this language compared to c++?

Re: minimize cpu usage [Re: Aku_Aku] #430944
10/06/13 15:35
10/06/13 15:35
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
No, please don't do this here. Don't destroy Kartoffel's thread any further with this nonsense discussion. I know, I shouldn't have answered wjbenders troll post in the first place...


Always learn from history, to be sure you make the same mistakes again...
Re: minimize cpu usage [Re: Aku_Aku] #430945
10/06/13 15:37
10/06/13 15:37
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
edit : said something good but saw the post above ..

so like i said gone .. i mentioned this is off topic but as others shared an oppinion i shared mine .. so go fuck yourself dude

sid everytime you write something i bow down ,
"me tiny grasshopper , you big master , you kung-fu gooooood"

Last edited by Wjbender; 10/06/13 15:42.

Compulsive compiler
Re: minimize cpu usage [Re: Wjbender] #430946
10/06/13 16:00
10/06/13 16:00
Joined: Jul 2013
Posts: 158
F
Feindbild Offline
Member
Feindbild  Offline
Member
F

Joined: Jul 2013
Posts: 158
Why so pissed, man?

Page 3 of 5 1 2 3 4 5

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1