You are comparing a bit different implementations. This is not a fair comparison.
For example in "C" version you are passing At pointer by address, and then dereference it and assign to local variable. Compiler now knows that At pointer cannot change - its in local variable which cannot be changed by anybody else outside of function.
In "C++" version you are using this->At all the time. Compiler doesn't know that "this" object is not shared with another thread. So it must reload At pointer every time it is accessed. Obviously it will be slower.
You need to assign in to local variable same as in "C" version (or change "C" version to do double dereference everywhere) if you want fair comparison.
This is very easy to see here:
fragment from "C" version:
| .LBB1_23: # =>This Inner Loop Header: Depth=1
movzx r10d, byte ptr [rsi + 2]
inc rsi
mov eax, r10d
add al, -48
cmp al, 10
jb .LBB1_23
|
rsi is used as a pointer.
fragment from "C++" version:
| .LBB1_2: # =>This Inner Loop Header: Depth=1
mov qword ptr [rdi + 8], rdx
movzx ecx, byte ptr [rdx]
mov eax, ecx
add al, -48
dec rdx
cmp al, 10
jae .LBB1_2
|
See how rdx pointer is reloaded from memory on every dereference inside inner loop!
As you see, this has nothing to do of how you are you declaring functions - member or not. This is only about how you write code that deals with pointers. And you wrote it differently in these two versions.