Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / interesting solution for dbp eating up the cpu

Author
Message
Xolatron old
21
Years of Service
User Offline
Joined: 25th Jan 2004
Location: The Star Forge Language: DBpro
Posted: 31st Aug 2005 00:37
Hey! I still punch 3-ring binder holes with the binder rings; for all other holes I use my pen .

I prefer making my projects in DBpro, if only for the familiarity and the ability to deposit my function libraries that I use directly into the program upon completion.

I've been coding in BASIC since the end of elementary school, an I can make a much better DBp app than a Java one, only beginning to learn in half a year ago.

-Xol

-Xol


DBpro IonRay IDE: Demo 0.1.0.0 available!
re faze
20
Years of Service
User Offline
Joined: 24th Sep 2004
Location: The shores of hell.
Posted: 10th Sep 2005 19:40
will this make it to a newsletter?

(trooper) "we came here to put you out of your misery"
(joseph) "misery? what misery, i love killing people, i love squishing them until their guts come out like chunky mustard!
re faze
20
Years of Service
User Offline
Joined: 24th Sep 2004
Location: The shores of hell.
Posted: 26th Sep 2005 02:35
just out of curiousity, is there any way to build a dll out of parts of an existing dll, since they are all independent functions more or less, could i create a new compiled binary using only selected functions from pre existing dll's?

you dont beat the system. the system beats you.
Catalyst
21
Years of Service
User Offline
Joined: 6th Sep 2003
Location:
Posted: 27th Sep 2005 22:30
Good solution, just got a chance to test it in my model viewer. Using sleep_cpu(1), I drop my CPU usage down to 0%, goes up to 2% if you're doing a lot, but barely. Program is a model viewer, so it still runs great.

However, I found something that I didn't see mentioned here. I ran it on some computers at work to test it out, these are systems for editing/dvd authoring so they really don't have much for video cards, but they have good processors. My model viewer has playback controls for animation on the models and when you play them, it would be slow. Not the playback or anything, it all operated fine. But say I press play, it will take a second to start playing, hit pause and it will keep playing for a second then pause. I put a "High Performance" mode into the program so users could turn this function off if it caused issues. That fixed it.

Just something to watch out for when using this. Other than that it's great, I just wouldn't want to release something with this that it could not be toggled.
re faze
20
Years of Service
User Offline
Joined: 24th Sep 2004
Location: The shores of hell.
Posted: 28th Sep 2005 01:31
yes you could make a slider using a value from 0 to 4 to control performance.
i am glad you found this helpful but the question above was kinda pressing

you dont beat the system. the system beats you.
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 28th Sep 2005 11:01
The only way I can think of you being able to do that is to decompile the DLL, pick out what you want and then recompile them... Also, most functions aren't independant. If something is coded correctly, it uses a LOT of dependance on other functions, otherwise the code gets huge and unmanagable.

My Website:
re faze
20
Years of Service
User Offline
Joined: 24th Sep 2004
Location: The shores of hell.
Posted: 28th Sep 2005 17:09
aw crap. thanks though, ill find another way....

you dont beat the system. the system beats you.
re faze
20
Years of Service
User Offline
Joined: 24th Sep 2004
Location: The shores of hell.
Posted: 9th Oct 2005 10:17
any of the tgc developers, is it okay to decompile a dll to recomile it into a new dll? or is this illegal?

you dont beat the system. the system beats you.
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 9th Oct 2005 11:10
illegal.

Decompiling is reverse engineering, and that's illegal

Team EOD :: All-Round Nice Guy
Want Better dbHelp Files?
games coder
20
Years of Service
User Offline
Joined: 2nd Feb 2005
Location:
Posted: 10th Oct 2005 00:49
Isn't this code a little overcomplicated? I've always thought that the SLEEP command will execute the kernel's sleep function. I have been using it to lower CPU usage for a long time...


http://www.freewebtown.com/rioplata
http://rioplata.iwarp.com/
re faze
20
Years of Service
User Offline
Joined: 24th Sep 2004
Location: The shores of hell.
Posted: 10th Oct 2005 01:25
sleepex allows more precise cpu usage control so it can be varied from 0-100 rather than being confined to 0-1% yeilding more control and better performance.

you dont beat the system. the system beats you.
Xolatron old
21
Years of Service
User Offline
Joined: 25th Jan 2004
Location: The Star Forge Language: DBpro
Posted: 10th Oct 2005 19:17
No, DB(p) sleep doesn't call the CPU's sleep, so the CPU remains at 100%.

-Xol


DBpro IonRay IDE: Demo 0.1.0.0 available!
headcrab 53
20
Years of Service
User Offline
Joined: 14th Jul 2005
Location:
Posted: 12th Oct 2005 22:39
Quote: "That works good for cutting it back, but I wonder how you speed it up. No matter what code I run, I can't get DBP to use ove 50% CPU. The FPS just keep dropping instead of CPU usage increasing Is it because I have a hyperthreading processor?
"


Yes, it is. Any direct X application won't use more than 50% in total. I also have a hyperthreading processor. I had the Windows Task Manager open while Half-Life 2 was running. One CPU was being used 100% and the other was at about 1% - 5%, with the average on the side at 50%-60%. Make sure you have it set to show one graph per CPU and you'll be able to see that.

If you can read this, you are over qualified.
the_winch
22
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 13th Oct 2005 01:09
Quote: "Decompiling is reverse engineering, and that's illegal"


Reverse engineering illegal

Copyright is the reason you can't rip bits out of someone else's dll and stick them in your own.
TGC will be pretty strict about how you can distribute their dlls because you could potentially use them to make a free dark game SDK.
Child Online
19
Years of Service
User Offline
Joined: 7th Nov 2005
Location:
Posted: 7th Nov 2005 14:40
Right, so i'm a kind of a noob. I tried all the prev. codes & didn't go no result what so ever. Except processor lower usage.


But the @#%#&# FPS is really low.
(8/9/10 FPS)

Whose to blame DBP/USER/CODE/kernel32.dll
Child Online
19
Years of Service
User Offline
Joined: 7th Nov 2005
Location:
Posted: 6th Dec 2005 12:48
Hi I have tried The "kernel32.dll" solution and i had an interesting result using FRAPS 6.0 (to see how many FPS i have in my projects)

Although i used the "sync rate 60" command. Fraps is telling me I have 32 - 33 FPS

Login to post a reply

Server time is: 2025-08-08 10:43:04
Your offset time is: 2025-08-08 10:43:04