Hi, Manu wrote: > I have no ARM machine to check whether that carries over to > repeat_bytes().
I ran v5 on an Apple M2 Max. It does not carry over. repeat() with a one byte source matches the memset() patch, and rpad() to 100M goes from 304 ms to 5.5 ms. For the short cases I counted instructions instead of time, by reading proc_pid_rusage() for the backend around each statement. Two master servers agree to within one instruction per call. Two things are slower than master. lpad(s, 7, '0') takes 772 instructions per call against 694 on master. Padding costs more up to three characters and breaks even at four. repeat() with a 1000 byte source and a 10M result runs fewer instructions, 4.06M against 4.33M, but is 24% slower. So that one is memory cost. Changing the block size does not help here. Thanks, Shihao
