Benchmark test - VB6/VC6/Delphi6/Java

Discussion in 'Programming General' started by Govind, Mar 15, 2008.

Benchmark test - VB6/VC6/Delphi6/Java
  1. Unread #21 - Mar 18, 2008 at 8:24 AM
  2. Nullware
    Joined:
    Jan 30, 2007
    Posts:
    1,761
    Referrals:
    4
    Sythe Gold:
    0

    Nullware Guru

    Benchmark test - VB6/VC6/Delphi6/Java

    I tried VC++ 2008 Express and I'm getting slightly better times but still slower than you, probably because of all the processes running the school has setup on this laptop.
    I assume that since he mentioned it, it probably takes less resources and would thus take far less time.
     
  3. Unread #22 - Mar 18, 2008 at 5:35 PM
  4. BrianTokyo
    Referrals:
    0

    BrianTokyo Guest

    Benchmark test - VB6/VC6/Delphi6/Java

    Interesting stuff, I love trying out different methods etc to test speed.

    I took a 10.000 sample for a more accurate result
    Delphi2007/Vista/X2 6000+

    200-250 ms

    Code:
    program Project2;
    
    {$APPTYPE CONSOLE}
    
    uses
      Windows;
    var
    i,j,start,endtime:Longint;
    data: array[1..10000] of Byte;
    procedure CvtInt;
    asm
            OR      CL,CL
            JNZ     @CvtLoop
    @C1:    OR      EAX,EAX
            JNS     @C2
            NEG     EAX
            CALL    @C2
            MOV     AL,'-'
            INC     ECX
            DEC     ESI
            MOV     [ESI],AL
            RET
    @C2:    MOV     ECX,10
    
    @CvtLoop:
            PUSH    EDX
            PUSH    ESI
    @D1:    XOR     EDX,EDX
            DIV     ECX
            DEC     ESI
            ADD     DL,'0'
            CMP     DL,'0'+10
            JB      @D2
            ADD     DL,('A'-'0')-10
    @D2:    MOV     [ESI],DL
            OR      EAX,EAX
            JNE     @D1
            POP     ECX
            POP     EDX
            SUB     ECX,ESI
            SUB     EDX,ECX
            JBE     @D5
            ADD     ECX,EDX
            MOV     AL,'0'
            SUB     ESI,EDX
            JMP     @z
    @zloop: MOV     [ESI+EDX],AL
    @z:     DEC     EDX
            JNZ     @zloop
            MOV     [ESI],AL
    @D5:
    end;
    function IntToStr(Value: Integer): string;
    asm
            PUSH    ESI
            MOV     ESI, ESP
            SUB     ESP, 16
            XOR     ECX, ECX       // base: 0 for signed decimal
            PUSH    EDX            // result ptr
            XOR     EDX, EDX       // zero filled field width: 0 for no leading zeros
            CALL    CvtInt
            MOV     EDX, ESI
            POP     EAX            // result ptr
            CALL    System.@LStrFromPCharLen
            ADD     ESP, 16
            POP     ESI
    end;
    begin
      start := GetTickCount();
      for i := 1 to 1000 do
      begin
            for j := 1 to 10000 do
            begin
                    data[j] := Random(32767) mod 100;
            end;
      end;
      endtime := GetTickCount();
      WriteLn('That took ' + IntToStr(endtime-start) + ' milliseconds to finish.');
      sleep(1000);
    end.
     
  5. Unread #23 - Mar 18, 2008 at 6:59 PM
  6. Govind
    Joined:
    Apr 22, 2005
    Posts:
    7,825
    Referrals:
    13
    Sythe Gold:
    23
    Prove it! Trole Tier 1 Prizebox Tortoise Penis Le Monkey UWotM8? Wait, do you not have an Archer rank? Potamus

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Benchmark test - VB6/VC6/Delphi6/Java

    Nice work on writing your own int/str conversion functions, though I barely understand ASM :p
     
  7. Unread #24 - Mar 18, 2008 at 7:28 PM
  8. BrianTokyo
    Referrals:
    0

    BrianTokyo Guest

    Benchmark test - VB6/VC6/Delphi6/Java

    lol I didn't write them, just copied them over from SysUtils so I don't need to include the whole unit (smaller exe)
     
  9. Unread #25 - Mar 18, 2008 at 8:12 PM
  10. Govind
    Joined:
    Apr 22, 2005
    Posts:
    7,825
    Referrals:
    13
    Sythe Gold:
    23
    Prove it! Trole Tier 1 Prizebox Tortoise Penis Le Monkey UWotM8? Wait, do you not have an Archer rank? Potamus

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Benchmark test - VB6/VC6/Delphi6/Java

    Oh, I see.
     
  11. Unread #26 - Mar 18, 2008 at 10:02 PM
  12. BrianTokyo
    Referrals:
    0

    BrianTokyo Guest

    Benchmark test - VB6/VC6/Delphi6/Java

    im still leet though
     
  13. Unread #27 - Mar 18, 2008 at 10:05 PM
  14. Govind
    Joined:
    Apr 22, 2005
    Posts:
    7,825
    Referrals:
    13
    Sythe Gold:
    23
    Prove it! Trole Tier 1 Prizebox Tortoise Penis Le Monkey UWotM8? Wait, do you not have an Archer rank? Potamus

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Benchmark test - VB6/VC6/Delphi6/Java

    Pssh. Whatever. :p
     
  15. Unread #28 - Mar 18, 2008 at 10:32 PM
  16. BrianTokyo
    Referrals:
    0

    BrianTokyo Guest

    Benchmark test - VB6/VC6/Delphi6/Java

    I was quite shocked to see C# do so well btw, didn't expect that crap to be so close to c/delphi
     
  17. Unread #29 - Mar 18, 2008 at 11:11 PM
  18. Govind
    Joined:
    Apr 22, 2005
    Posts:
    7,825
    Referrals:
    13
    Sythe Gold:
    23
    Prove it! Trole Tier 1 Prizebox Tortoise Penis Le Monkey UWotM8? Wait, do you not have an Archer rank? Potamus

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Benchmark test - VB6/VC6/Delphi6/Java

    Well clock speed varies, but the ratio between speeds of different languages will probably be identical (or close to identical) from computer to computer.
     
  19. Unread #30 - Mar 19, 2008 at 2:40 AM
  20. Covey
    Joined:
    Sep 9, 2005
    Posts:
    4,510
    Referrals:
    9
    Sythe Gold:
    9
    Discord Unique ID:
    807246764155338833
    Discord Username:
    Covey#1816

    Covey Creator of EliteSwitch
    Retired Sectional Moderator Visual Basic Programmers

    Benchmark test - VB6/VC6/Delphi6/Java

    Honestly, this thread has been the most productive programming thread in a long time.

    Just thought i'd add that random note.
     
  21. Unread #31 - Mar 19, 2008 at 3:22 AM
  22. Larry
    Joined:
    Feb 2, 2007
    Posts:
    267
    Referrals:
    2
    Sythe Gold:
    5

    Larry Forum Addict

    Benchmark test - VB6/VC6/Delphi6/Java

    Thank you for the efforts, still I think there something i cannot agree with:
    1- The random thing, it would have been better to fill a random array first then test the transfer, as in the case you posted, the full benchmark is about testing the "rnd" function (which differs from implementation to another, and which is rarely a perf issue so none of the implementors looks forward optimizing it).
    2- the timings are very very small, i think that upping the number of times you fill the array with a bigger array should bring the timings into more interpretable results like in seconds, timings in milliseconds cannot be used in benchmarks since the precision is already around 4 ms (so that's over 50% of imprecision in some cases ! ), and to show this easily, try reducing the number of elements and you can end up with negative benchmarks (ie the tests looks finishing before starting , and this is really hilarious).

    I hope you see the logic behind what i wrote, and hope not getting flamed much !
     
  23. Unread #32 - Mar 19, 2008 at 3:50 AM
  24. BrianTokyo
    Referrals:
    0

    BrianTokyo Guest

    Benchmark test - VB6/VC6/Delphi6/Java

    That's why I upped the iteration x10, as we saw in the other tests the results were mostly 16 OR 31, not something in between, so it's clear the precission in ms by using gettickcount isn't very good. I often try to at least take samples of 5-10 seconds running several thousands of iterations until an acceptable timing when I test different methods for speed.
     
  25. Unread #33 - Mar 19, 2008 at 10:57 PM
  26. Govind
    Joined:
    Apr 22, 2005
    Posts:
    7,825
    Referrals:
    13
    Sythe Gold:
    23
    Prove it! Trole Tier 1 Prizebox Tortoise Penis Le Monkey UWotM8? Wait, do you not have an Archer rank? Potamus

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Benchmark test - VB6/VC6/Delphi6/Java

    The only problem is that arrays that are 10000 elements long are too large for VB6.
     
  27. Unread #34 - Mar 20, 2008 at 2:39 AM
  28. Covey
    Joined:
    Sep 9, 2005
    Posts:
    4,510
    Referrals:
    9
    Sythe Gold:
    9
    Discord Unique ID:
    807246764155338833
    Discord Username:
    Covey#1816

    Covey Creator of EliteSwitch
    Retired Sectional Moderator Visual Basic Programmers

    Benchmark test - VB6/VC6/Delphi6/Java

    Use a "Long" instead of an "Integer" & it will be fine.
     
  29. Unread #35 - Mar 20, 2008 at 9:43 AM
  30. Govind
    Joined:
    Apr 22, 2005
    Posts:
    7,825
    Referrals:
    13
    Sythe Gold:
    23
    Prove it! Trole Tier 1 Prizebox Tortoise Penis Le Monkey UWotM8? Wait, do you not have an Archer rank? Potamus

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Benchmark test - VB6/VC6/Delphi6/Java

    Sure, I"ll repost a better one later.
     
  31. Unread #36 - Jun 12, 2008 at 2:07 AM
  32. BrianTokyo
    Referrals:
    0

    BrianTokyo Guest

    Benchmark test - VB6/VC6/Delphi6/Java

    Here's a much better way than using GetTickCount (whose resolution is limited to min. ~17-20 ms)

    Code:
    var PF, PC0, PC1: Int64;
        i,j:Longint;
        data: array[1..10000] of Byte;
    
    
     QueryPerformanceFrequency(PF);
     QueryPerformanceCounter(PC0);
     for i := 1 to 10000 do
      for j := 1 to 1000 do
       data[j] := Random(32767) mod 100;
     QueryPerformanceCounter(PC1);
     ShowMessage(IntToStr(((PC1-PC0)*1000) div PF));
     
< Combo box addressing need help! | My First Java Program >

Users viewing this thread
1 guest


 
 
Adblock breaks this site