Dont calculate values twice like the Player Base or so.. Get it once and Use that variable. If you have any infinite loops add Sleep(1); at the end of the loop to reduce CPU usage.. My Major Tips
hey. my hack raises the load of my CPU to 40 percent, and FPS in the game fell from 300 to 130, it's awful. How to optimize my external hack?
Last edited by SP1K3CSGO; 03-21-2016 at 05:30 AM.
Dont calculate values twice like the Player Base or so.. Get it once and Use that variable. If you have any infinite loops add Sleep(1); at the end of the loop to reduce CPU usage.. My Major Tips
SP1K3CSGO (03-21-2016)
- if you are using Threads, try to stop them properly to avoid problems.
- use a smart allocating memory method and don't use more than you need.
- think about your algorithms before doing them
Enjoy
If you dont know how to optimize, stick to one thread untill you learn (Its common sense really).
Just time your operations, this is how I do it:
Lambda A would only be called if 55 milliseconds has past since the last call to it.Code:// A (window->OnTick( ) += []( dx::Window *sender, dx::MessageData &data ) { // do yer l33t bhop here }).Every( std::chrono::milliseconds( 55 ) ); // B (window->OnTick( ) += []( dx::Window *sender, dx::MessageData &data ) { // do yer l33t trigger here }).Every( std::chrono::milliseconds( 60 ) ); // C (window->OnTick( ) += []( dx::Window *sender, dx::MessageData &data ) { // Maybe some random update that only needs to be called every 500 milliseconds }).Every( std::chrono::milliseconds( 500 ) );
Lambda B would only be called if 60 milliseconds has past since the last call to it.
Lambda C would only be called if 500 milliseconds has past since the last call to it.
Thats a good way to split each feature into different parts of your code, but still keeping it to 1 thread.
To implement something like this just create a function wrapper, this is how I do it:
Event.h
Last edited by Yemiez; 03-21-2016 at 08:37 AM.
SP1K3CSGO (03-21-2016)
The danger of using only one thread (which is what this sounds like) is making a hyper-thread, eating away processor power and multi-threading is by far the greater choice.
Some tips that may help you:
Check compiler settings
Erase unused/useless code or store it elsewhere (unless you're using code-optimizing)
Tend to your thread(s) and their sleeps
Don't overwrite or make variables over and over unless needed
Check for memory leaks
If able, read whole structs in memory instead of calling multiple RPM's
Update slow old fashioned methods with superior ones
++ more
If you're really interested and not really into ghetto-fixes I'd advice you to read on more pure code related places where people tend to treat their code more gentle.
1 week has passed and no further replies have been made by the OP. Assuming solved.
/Closed.