fasthash icon indicating copy to clipboard operation
fasthash copied to clipboard

jody: fix checkptr segfault

Open yerden opened this issue 2 years ago • 1 comments

Fix checkptr segfault by disallowing advancing pointer beyond the Go allocation.

Signed-off-by: Yerden Zhumabekov [email protected]

yerden avatar Jan 06 '23 11:01 yerden

$ benchstat old.txt new.txt
name                                 old time/op    new time/op    delta
Hash64/jody/optimized/strlen=4-4       5.59ns ± 1%    5.68ns ± 4%   +1.63%  (p=0.043 n=9+10)
Hash64/jody/optimized/strlen=11-4      7.71ns ± 3%    6.91ns ± 1%  -10.45%  (p=0.000 n=10+10)
Hash64/jody/optimized/strlen=36-4      10.6ns ± 1%    10.5ns ± 1%   -1.07%  (p=0.001 n=10+9)
Hash64/jody/optimized/strlen=1000-4     283ns ± 0%     281ns ± 0%   -0.71%  (p=0.000 n=10+10)

name                                 old speed      new speed      delta
Hash64/jody/optimized/strlen=4-4      716MB/s ± 1%   704MB/s ± 3%   -1.57%  (p=0.043 n=9+10)
Hash64/jody/optimized/strlen=11-4    1.43GB/s ± 3%  1.59GB/s ± 1%  +11.66%  (p=0.000 n=10+10)
Hash64/jody/optimized/strlen=36-4    3.39GB/s ± 1%  3.43GB/s ± 1%   +1.09%  (p=0.002 n=10+9)
Hash64/jody/optimized/strlen=1000-4  3.53GB/s ± 0%  3.55GB/s ± 0%   +0.72%  (p=0.000 n=10+10)

yerden avatar Jan 06 '23 15:01 yerden