Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 10/24/21 in all areas

  1. Lars Fosdal

    Rest in peace dear Danny Thorpe

    Danny Thorpe was one of the pillars that Delphi is founded on. A giant among giants. His legacy is solid and we will remember him with love and respect, and send our condolences to his family.
  2. dummzeuch

    GExperts 1.3.19 Alpha for Delphi 11

    There is a now an installer for version 1.3.19 Alpha of GExperts for Delphi 11.
  3. Further to a previous post of mine, I have done some benchmarking to compare the different alternatives. I am using some old benchmark code from Barry Kelly and added a few more options (word of char in, Char.IsInArray and if then). Here are the 6 ways compared: while not CharInSet(cp^, [#0, #13, #10]) do case statement while not (cp^ in [#0, #13, #10]) do (raises a warning) while not (Word(cp^) in [$0, $A, $D]) do while not (cp^.IsInArray([#0, #13, #10])) do while (cp^<>#0) and (cp^<>#$A) and (cp^<>#$D) do Results with optimization turned on. Win32 1. CharInSet: 0.037 seconds 2. case stmt: 0.039 seconds 3. set test: 0.036 seconds 4. Word set test: 0.037 seconds 5. InArray test: 0.219 seconds 6. if and test: 0.037 seconds Win64 1. CharInSet: 0.106 seconds 2. case stmt: 0.047 seconds 3. set test: 0.042 seconds 4. Word set test: 0.044 seconds 5. InArray test: 0.248 seconds 6. if and test: 0.036 seconds What is worrying is that in 64 bits both CharInSet and IsInArray (the recommended options) are much slower than the alternatives. CharInSet is an inlined version of Option 3, but the code cannot take advantage of the specific contents of the set. Here is the assembly code: CharInSet.dpr.15: while not CharInSet(cp^, [#0, #13, #10]) do 0000000000429DAA 480FB708 movzx rcx,word ptr [rax] 0000000000429DAE 6681F9FF00 cmp cx,$00ff 0000000000429DB3 7711 jnbe P1 + $36 0000000000429DB5 480FB7C9 movzx rcx,cx 0000000000429DB9 480FA30D37000000 bt [rel $00000037],rcx 0000000000429DC1 0F92C1 setb cl 0000000000429DC4 EB02 jmp P1 + $38 0000000000429DC6 33C9 xor ecx,ecx 0000000000429DC8 84C9 test cl,cl 0000000000429DCA 74DA jz P1 + $16 CharInSet.dpr.41: while not (cp^ in [#0, #13, #10]) do 000000000042A05A 480FB708 movzx rcx,word ptr [rax] 000000000042A05E 6683F90F cmp cx,$0f 000000000042A062 7716 jnbe P3 + $3A 000000000042A064 66BA0100 mov dx,$0001 000000000042A068 D3E2 shl edx,cl 000000000042A06A 480FB70D3A000000 movzx rcx,word ptr [rel $0000003a] 000000000042A072 6685CA test dx,cx 000000000042A075 0F95C1 setnz cl 000000000042A078 EB02 jmp P3 + $3C 000000000042A07A 33C9 xor ecx,ecx 000000000042A07C 84C9 test cl,cl 000000000042A07E 74D6 jz P3 + $16 CharInSet.dpr.51: while not (Word(cp^) in [$0, $A, $D]) do 000000000042A1AA 480FB708 movzx rcx,word ptr [rax] 000000000042A1AE 6683F90F cmp cx,$0f 000000000042A1B2 7716 jnbe P4 + $3A 000000000042A1B4 66BA0100 mov dx,$0001 000000000042A1B8 D3E2 shl edx,cl 000000000042A1BA 480FB70D3A000000 movzx rcx,word ptr [rel $0000003a] 000000000042A1C2 6685CA test dx,cx 000000000042A1C5 0F95C1 setnz cl 000000000042A1C8 EB02 jmp P4 + $3C 000000000042A1CA 33C9 xor ecx,ecx 000000000042A1CC 84C9 test cl,cl 000000000042A1CE 74D6 jz P4 + $16 Options 2 and 6 are too verbose and Options 1 and 5 too slow. Option 4 (Word(cp^) in [$0, $A, $D]) produces the same code as option 3 (cp^ in [#0, #13, #10]) without raising an exception and it sounds like a good choice. Any downsides? Incidentally combining any of the above options with an initial test for the most common case e.g. while (Word(cp^) > $D) or not (Word(cp^) in [$0, $A, $D]) do is much faster! Source code attached. CharInSet.dpr
  4. Ian Branch

    The state of GExperts Support for Delphi 11

    Hi Thomas, Rev 3677 fails to build in D2007.
  5. Not sure which of the subforums to post, but here it goes: With great sadness, I just got word from both Julian Bucknall on Twitter and Lino Tadros on Facebook that my dear friend Danny Thorpe passed away on October 22nd, just a few hours ago. Still limited in energy, still recovering from many treatments, I will need to keep it short and hope to gain some more energy and blog a small obituary later. For now, I'm devastated. Loosing a friend and one of the instrumental Delph R&D team members from the days brings so many mixed emotions. I wish his wife Cindy and their loved ones all the best. Rest in peace dear Danny. The world will be different without you. --jeroen Referencs: - https://twitter.com/JMBucknall/status/1451674438097854464, https://twitter.com/jpluimers/status/1451677770552123399 - https://www.facebook.com/lino.tadros/posts/10158270097971179, https://www.facebook.com/cindy.f.thorpe/posts/10224108253026657
  6. DelphiUdIT

    Rest in peace dear Danny Thorpe

    RIP, one of the geniuses who created Delphi, VCL, Kylix. Truly an immense loss.
×