Words cannot describe... Data.DB.pas, TNamedItem.HashName

Words cannot describe... Data.DB.pas, TNamedItem.HashName

...

Comments

  1. It's amazing... so much micro optimizations, and then failing so hard on the big stuff. For those who can't check it out, here's the best bit:

          if Len > BufferLen then
            GetMem(Data, Len * SizeOf(Char))
          else
            Data :=@Buffer[0];
          Move(Pointer(AnsiUpperCase(Name))^, Data^, Len * SizeOf(Char));

    What does AnsiUpperCase do? It of course allocates a brand new string, copies the data over and then calls CharUpperBuff (on Windows).

    And what does the HashName code do with this "Data" array? It simply loops over each character to compute the hash...

    ReplyDelete

Post a Comment