The string const calls the _UStrLAsg call, and the resource string ends with LoadResString .
Since the question of speed has nothing to do with the test.
resourcestring str2 = 'str2'; const str1 = 'str1'; function ConstStr1: string; begin result := str1; end; function ReceStr1: string; begin result := str2; end; function ConstStr2: string; begin result := str1; end; function ReceStr2: string; begin result := str2; end; procedure Test; var s1, s2, s3, s4: string; begin s1 := ConstStr1; s2 := ReceStr1; s3 := ConstStr2; s4 := ReceStr2; end;
The first time I used AQTime, added to DelphiXE, to profile this code, and here is the result. The time column shows machine cycles.

I may have made a lot of newbie mistakes profiling this, but as I see it, there is a difference between const and resourcestring . If the difference is noticeable to the user, it depends on what you do with the string. In a loop with many iterations, this can make a difference, but it is used to display information to users, not so much.
Mikael eriksson
source share