Results 1 to 15 of 15
  1. #1
    topblast's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Far from around you Programmer: C++ | VB | C# | JAVA
    Posts
    3,607
    Reputation
    149
    Thanks
    5,052
    My Mood
    Cool

    Post Take advantage of Multi-Core Processors and Multi-threading

    MultiThreading is already in the programs u develop, just behind the scenes. Take advantage of it to improve the performance of those multi-core processors and optimize it for the single thread processors.

    example:
    Code:
    #include <ppl.h>
    
    using namespace Concurrency;
    
    void Hook()
    {
        parallel_invoke(
            [&] {
                //Hook Present
            },
            [&] {
                //Hook Endscene
            });
         );
    }
    This will allow u to do multiple things at a time using multiple threads.The number of threads are limited to the number of logical processor and single thread processors will not see any performance change. Something like this will help u with your menus. The reason menus lag is because of the font. Having to draw every character in every string for every item. For each character in a string, in each items, that is a lot of time wasted in looping, but what if u could do more than one of these at a time.

    Example:
    Please note that fonts not coded for concurrency may have rendering errors, if requested i will be willing to code a Font class for Concurrency
    Code:
    //This function will return the time it takes to call the function
    template <class Function>
    __int64 time_call(Function&& f){
       __int64 begin = GetTickCount();
       f();
       return GetTickCount() - begin;
    }
    
    
    void DrawParallel()
    {
    	parallel_for(0, 10, [&] (int i)
    	{
    		Font.DrawText(200, 20+ i*15, WHITE, "BLA BLA BLA");
    	});
    }
    
    
    void DrawSerial()
    {
    	for(int i = 0; i < 10; i++)
    	{
    		Font.DrawText(20 , 20 + i*15, WHITE, "BLA BLA BLA");
    	}
    }
    
    
    void RenderFont()
    {
    // Draws the time it takes to do these different Draws.
    	Font.DrawNumber( 200, 10, WHITE, time_call([&] { DrawParallel(); } ));
    	Font.DrawNumber( 20, 10, WHITE, time_call([&] { DrawSerial(); } ));
    }
    Depending on the number of logical cores the time it takes to render these times may differ.
    Last edited by topblast; 08-18-2012 at 02:27 PM.
    I just like programming, that is all.

    Current Stuff:

    • GPU Programmer (Cuda)
    • Client/Server (Cloud Server)
    • Mobile App Development

  2. The Following 8 Users Say Thank You to topblast For This Useful Post:

    arun823 (08-18-2012),demtrios (08-19-2012),Drake (08-20-2012),[MPGH]Flengo (08-26-2012),luccss (08-18-2012),NotRealPro (08-19-2012),Password77 (08-18-2012),pDevice (08-18-2012)

  3. #2
    Password77's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Location
    Canada, ON
    Posts
    179
    Reputation
    10
    Thanks
    181
    My Mood
    Cheerful
    Thank you, I will make sure I implement this .
    Doing more Java and Python
    Need help with your hack? Ask me, I will try to help you with all my might .

  4. #3
    luccss's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Posts
    482
    Reputation
    183
    Thanks
    3,440
    My Mood
    Breezy
    thanks top

  5. #4
    kotentopf's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Posts
    602
    Reputation
    26
    Thanks
    251
    little info for beginners, how it works(shown in screenshots):
    the code(tip: there is a namespace, but you should already figured it out)

    first run

    second run


    you should see it. result is based on a dual core, 2.2GHz

    ignore title of project, was a demo for my classmates lol
    The Internet SHOULD Be Illegal

    When you say
    "Java is a great programming language because it works on all platforms"
    it is just like
    "anal sex is great because it works on all genders"

    Are YOU a Troll?

  6. The Following User Says Thank You to kotentopf For This Useful Post:

    topblast (08-19-2012)

  7. #5
    topblast's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Far from around you Programmer: C++ | VB | C# | JAVA
    Posts
    3,607
    Reputation
    149
    Thanks
    5,052
    My Mood
    Cool
    yes, it doesnt run things one after the other, but a random number can be picked to run in the threads

    Because of this limits of 2 cores (guessing u have 2 threads), some threads are used again to process the information, so it Serializing in the parallel threads.

    Running this code to time it and Sleep for 10 ms i got the times below, u can see the difference 8 threaded processor have over the 4 threaded one when using parallelism.
    Code:
    #include <iostream>
    #include <Windows.h>
    #include <ppl.h>
    
    template <class Function>
    __int64 time_call(Function&& f){
       __int64 begin = GetTickCount();
       f();
       return GetTickCount() - begin;
    }
    
    int main(int argc, char** argv)
    {
    	printf("Time : %i\r\n\n",time_call([&]{
    
    		Concurrency::parallel_for(0, 50,[&](int i)
    		{
    			printf("Output %i\r\n", i);
    			Sleep(10);
    		});
    	}));
    	system("pause");
    	return 0;
    }
    Running this code to time it and Sleep for 10 ms i got the times below, there is no difference between the 8 threaded processor and the 4 threaded one when using traditional for loops, performance wasted.
    Code:
    #include <iostream>
    #include <Windows.h>
    #include <ppl.h>
    
    template <class Function>
    __int64 time_call(Function&& f){
       __int64 begin = GetTickCount();
       f();
       return GetTickCount() - begin;
    }
    
    int main(int argc, char** argv)
    {
    	printf("Time : %i\r\n\n",time_call([&]{
    		for(int i=0; i<50;i++)
    		{
    			printf("Output %i\r\n", i);
    			Sleep(10);
    		}
    	}));
    	system("pause");
    	return 0;
    }


    ---------- Post added at 11:05 PM ---------- Previous post was at 10:53 PM ----------
    Test for AMD Phenom II x4 (Quad Core, 4 Thread) = 125 ms vs 499ms




    ---------- Post added at 11:09 PM ---------- Previous post was at 11:05 PM ----------

    Test for Intel CORE i7 sandybridge (Quad Core x2 threads, 8 Threads ) = 62ms ~ 78 ms vs 499ms
    : This is why Intel Better, more threads in a core, so 8 logical processors, just saying
    Last edited by topblast; 08-19-2012 at 11:34 PM.
    I just like programming, that is all.

    Current Stuff:

    • GPU Programmer (Cuda)
    • Client/Server (Cloud Server)
    • Mobile App Development

  8. #6
    matypatty's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Posts
    864
    Reputation
    229
    Thanks
    2,694
    My Mood
    Amused
    race me to 3000



    Intel i5 760 @2.8ghz
    Last edited by matypatty; 08-20-2012 at 04:22 AM.

  9. #7
    kotentopf's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Posts
    602
    Reputation
    26
    Thanks
    251
    Quote Originally Posted by matypatty View Post
    race me to 3000



    Intel i5 760 @2.8ghz
    you have the biggest penis. gratz.
    The Internet SHOULD Be Illegal

    When you say
    "Java is a great programming language because it works on all platforms"
    it is just like
    "anal sex is great because it works on all genders"

    Are YOU a Troll?

  10. #8
    abathx's Avatar
    Join Date
    Aug 2012
    Gender
    male
    Location
    On Your Screen.
    Posts
    152
    Reputation
    10
    Thanks
    35
    My Mood
    Devilish
    Quote Originally Posted by kotentopf View Post
    you have the biggest penis. gratz.
    He really Does.

  11. #9
    kotentopf's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Posts
    602
    Reputation
    26
    Thanks
    251
    Quote Originally Posted by abathx View Post
    He really Does.


    could we now stop share penis size?
    The Internet SHOULD Be Illegal

    When you say
    "Java is a great programming language because it works on all platforms"
    it is just like
    "anal sex is great because it works on all genders"

    Are YOU a Troll?

  12. The Following User Says Thank You to kotentopf For This Useful Post:

    matypatty (08-21-2012)

  13. #10
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by topblast View Post
    MultiThreading is already in the programs u develop, just behind the scenes. Take advantage of it to improve the performance of those multi-core processors and optimize it for the single thread processors.

    example:
    Code:
    #include <ppl.h>
    
    using namespace Concurrency;
    
    void Hook()
    {
        parallel_invoke(
            [&] {
                //Hook Present
            },
            [&] {
                //Hook Endscene
            });
         );
    }
    This will allow u to do multiple things at a time using multiple threads.The number of threads are limited to the number of logical processor and single thread processors will not see any performance change. Something like this will help u with your menus. The reason menus lag is because of the font. Having to draw every character in every string for every item. For each character in a string, in each items, that is a lot of time wasted in looping, but what if u could do more than one of these at a time.

    Example:
    Please note that fonts not coded for concurrency may have rendering errors, if requested i will be willing to code a Font class for Concurrency
    Code:
    //This function will return the time it takes to call the function
    template <class Function>
    __int64 time_call(Function&& f){
       __int64 begin = GetTickCount();
       f();
       return GetTickCount() - begin;
    }
    
    
    void DrawParallel()
    {
    	parallel_for(0, 10, [&] (int i)
    	{
    		Font.DrawText(200, 20+ i*15, WHITE, "BLA BLA BLA");
    	});
    }
    
    
    void DrawSerial()
    {
    	for(int i = 0; i < 10; i++)
    	{
    		Font.DrawText(20 , 20 + i*15, WHITE, "BLA BLA BLA");
    	}
    }
    
    
    void RenderFont()
    {
    // Draws the time it takes to do these different Draws.
    	Font.DrawNumber( 200, 10, WHITE, time_call([&] { DrawParallel(); } ));
    	Font.DrawNumber( 20, 10, WHITE, time_call([&] { DrawSerial(); } ));
    }
    Depending on the number of logical cores the time it takes to render these times may differ.
    Don't be shit, blit!

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  14. #11
    topblast's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Far from around you Programmer: C++ | VB | C# | JAVA
    Posts
    3,607
    Reputation
    149
    Thanks
    5,052
    My Mood
    Cool
    Quote Originally Posted by Jason View Post


    Don't be shit, blit!
    I dont comprehend


    ---------- Post added at 11:31 PM ---------- Previous post was at 11:29 PM ----------

    Quote Originally Posted by kotentopf View Post
    you have the biggest penis. gratz.
    Mines bigger, that plus i am black
    I just like programming, that is all.

    Current Stuff:

    • GPU Programmer (Cuda)
    • Client/Server (Cloud Server)
    • Mobile App Development

  15. The Following User Says Thank You to topblast For This Useful Post:

    matypatty (08-21-2012)

  16. #12
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by topblast View Post


    I dont comprehend
    Of course you don't, which is why you're using parallelism as a crutch for crap DX code.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  17. #13
    topblast's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Far from around you Programmer: C++ | VB | C# | JAVA
    Posts
    3,607
    Reputation
    149
    Thanks
    5,052
    My Mood
    Cool
    Quote Originally Posted by Jason View Post


    Of course you don't, which is why you're using parallelism as a crutch for crap DX code.
    i am using for the stuff that lags the most in these hacks and pretty much, If i can help educate the people in this section I take it for that.
    I just like programming, that is all.

    Current Stuff:

    • GPU Programmer (Cuda)
    • Client/Server (Cloud Server)
    • Mobile App Development

  18. #14
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by topblast View Post


    i am using for the stuff that lags the most in these hacks and pretty much, If i can help educate the people in this section I take it for that.
    You're avoiding the problem, not addressing it. Anyways, we've had this discussion before so there's no need to rehash it but even with my extremely limited knowledge of directX, I can see lots of better ways to improve menu efficiency rather than just taking a "fuck it, computers are powerful, I don't need to code well" approach.

    Off-screen surfaces,
    Blitting,
    Rendering to the backbuffer.

    Google any, or a combination of these and you'll see what I'm talking about. A huge portion of the menu never changes, and when it does it's usually in response to user input. There's no need to redraw the menu piece-by-piece every time present/endscene is called. Simply draw it to an offscreen surface once and blit it to the display when needed. When the user provides some input, you can just redraw the offending parts on the offscreen surface (or the whole menu if need be). Far less unnecessary overhead and calls to performancing-hitting functions like DrawText.

    As I said, I have only a limited knowledge of DX, there are probably dozens of ways to further improve efficiency.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  19. #15
    topblast's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Far from around you Programmer: C++ | VB | C# | JAVA
    Posts
    3,607
    Reputation
    149
    Thanks
    5,052
    My Mood
    Cool
    Quote Originally Posted by Jason View Post


    You're avoiding the problem, not addressing it. Anyways, we've had this discussion before so there's no need to rehash it but even with my extremely limited knowledge of directX, I can see lots of better ways to improve menu efficiency rather than just taking a "fuck it, computers are powerful, I don't need to code well" approach.

    Off-screen surfaces,
    Blitting,
    Rendering to the backbuffer.

    Google any, or a combination of these and you'll see what I'm talking about. A huge portion of the menu never changes, and when it does it's usually in response to user input. There's no need to redraw the menu piece-by-piece every time present/endscene is called. Simply draw it to an offscreen surface once and blit it to the display when needed. When the user provides some input, you can just redraw the offending parts on the offscreen surface (or the whole menu if need be). Far less unnecessary overhead and calls to performancing-hitting functions like DrawText.

    As I said, I have only a limited knowledge of DX, there are probably dozens of ways to further improve efficiency.
    my sites are approach have change, the thing is I already optimized the DX functions as much as my current knowledge can take me. now i am optimizing it be putting speed into the memory manipulation.

    Also it will be more work than anything to be checking to see if the menu change also many functions of the menus requires the part that people don't see.
    The part i am really trying to optimize is the filling of the vertices for the font.

    while (*strText++)

    as it adds one character to the vertexbuffer. this part is not really d3d its filling an array, a large array.

    If u have any ideas please share.
    I just like programming, that is all.

    Current Stuff:

    • GPU Programmer (Cuda)
    • Client/Server (Cloud Server)
    • Mobile App Development

Similar Threads

  1. [Discussion] dragon sea gpk bypass and multi client v54
    By Ashley Dominique in forum Dragon Nest Discussions
    Replies: 2
    Last Post: 02-14-2012, 01:06 PM
  2. [Release] (AnimeArts) Injector and Multi Tool
    By AnimeArts in forum Combat Arms Spammers, Injectors and Multi Tools
    Replies: 11
    Last Post: 06-03-2011, 10:43 AM
  3. Join Rogue Unique, we will take on clans like Lifeline Trio and FGT.
    By kevinedler in forum CrossFire Clan Recruitment & Advertising
    Replies: 1
    Last Post: 01-09-2010, 05:04 PM
  4. *UNPATCHED* MULTI-Hack Aimbot and MUCH MORE :D
    By crazyxxjr in forum CounterStrike (CS) 1.6 Hacks / Counter Strike: Source (CSS) Hacks
    Replies: 2
    Last Post: 08-11-2009, 07:35 AM
  5. How to take advantage of buffer over-flows.
    By radnomguywfq3 in forum Programming Tutorials
    Replies: 1
    Last Post: 01-11-2009, 06:43 PM