Even brute force was better then Delphi !

From: The Half A Wannabee ("The)
Date: 02/25/04


Date: Wed, 25 Feb 2004 04:06:25 +0100

Delphi timings for 100_000_000 IntToString calls inside a loop

0,000-5,000-Start
210 537 760,000-210 537 760,000-Stopp

*First* RosAsm, brute force implementation :

Start 100_000_000 calls to IntegerToString :015 015
STOPP 100_000_000 calls to IntegerToString :175259271 175259256

Timings are given in TICKS. and on my machine, the counter ticks 3579545 per
second

This means DELPHI code took a total of ~58,82 seconds and RosAsm brute
force newbie code took ~48,96 seconds.

Speed improvement just from using RosAsm instead of Delphi = 17.24 % for my
first attempts ! Note that I had to write the PerformanceCounter in Delphi
too, so its not like development times are very much faster in delphi, even
for my very short experience. (RosAsm was 3 hours or so, but is not yet
complete) I do a lot of mistakes, and I would guess that when I am more
comfty with asm, development time with RosAsm will beat Delphi by
magnitudes. I see no reason not to program in asm, also when we talk about
the fun of programming. For other newbs, that are thinking of going asm
only. I dont think you will never regrett it. I thought I knew something
about programming, but rescent weeks have shown that I knew nothing, and
that the reason was for not using an assembler. Yes there is some startup
overhead, and many small irritating small problems to solve, but every day
you learn something new and existing, that you can use in all languages you
will program in, when you have to later.

Delphi code :

Procedure TSkinAppMAINWindow.ProgramStartup;
    var
      j : integer;
      S : String;
    begin
       Show;
       gPerformanceCounter := TPerformanceCounter.Create(lpNoparams);
       gPerformanceCounter.Start;
       gPerformanceCounter.TimeStampRemark('Start');
       for j := 0 to 100000000 do
       begin
          S := IntToStr( j )

       end;
       gPerformanceCounter.TimeStampRemark('Stopp');
       gPerformanceCounter.Stopp(false);
       gPerformanceCounter.SaveTofileAsText(gDesktopDir + '\Perf.txt');
       gPerformanceCounter.Free;
    end;

RosAsm code :

PerformanceCounter_SelfTest:
  Push edi
    mov D$WindowUtilDirectoryFlags 1
    call WindowUtil_OleSupport_Start
    call TPerformanceCounter_Create | mov D$PerformanceCounter edi
    call TPerformanceCounter_Start
    call TPerformanceCounter_TimeStampRemark TestRemark1

    mov ecx 100_000_000
   @TestPerformance:
    push ecx
           mov eax ecx |mov edx 0
           Call StringManager_IntegerToString
           Call StringManager_DisposeString eax
    pop ecx

    dec ecx
    jnz @TestPerformance
    call TPerformanceCounter_TimeStampRemark TestRemark2
    call TPerformanceCounter_Stop &FALSE

   push edi esi
      mov eax D$gDesktopDir
      call FileManager_ComposeFullFileNameEAX D$eax + TString_Pchar
PerformanceFileName
      Call TPerformanceCounter_SaveToTextFile D$eax + TString_Pchar
    pop esi edi

    Call TPerformanceCounter_Destroy

    call WindowUtil_OleSupport_Shutdown
  pop edi
  call TSkinSection_SetDisabled
  call TSZSkinWindow_RepaintWindow
ret

The performanceCounter is not completed yet, and only useful for small
timings. So complete code will be posted later. But for the current use, the
link is here :

http://www.szmyggenpv.com/downloads/PerformanceCounter.Zip



Relevant Pages

  • Re: ASM vs HLL : absurd war
    ... For REAL programmers RosAsm allready goes a LONG WAY. ... Well, for one thing, Delphi has an active drag and drop programming ... still runs at 4 times the speed as Delphis string ...
    (alt.lang.asm)
  • Re: Does MSIL Qualify?
    ... I realize I am getting spoiled with RosAsm, ... There are still some crashes with the debugger. ... Delphi, had bugs, at least uptil version 3.0 For instance, when replacing ... object memory, causing me to have to work in a real memory inspector to ...
    (alt.lang.asm)
  • Re: ASM vs HLL : absurd war
    ... For REAL programmers RosAsm allready goes a LONG WAY. ... > Well, for one thing, Delphi has an active drag and drop programming ... It CAN be done in a HLL, but if going asm, why not use an assembler, instead of a HLL? ...
    (alt.lang.asm)
  • Re: Question regarding "HLA" and its validity.
    ... I dont know half of what RosAsm is capable off. ... RosAsm has a better IDE than Delphi, and Delphi is an old story now. ... Integrated IDE * Integrated IDE ...
    (alt.lang.asm)
  • Re: Will HLA2.0 Support rosasm?
    ... really has programmed in RosAsm, ... Which remind me I promised Rene to check it out. ... I worked a lot more (Delphi) but with much ... what do you have to show for your 10 years of Delphi programming? ...
    (alt.lang.asm)