I wrote:
> So, clearly, the struct-as-return-value approach nowadays generates
> more efficient code than when mbiter was designed (in 2001-2005).
>
> I will thus create new variants of mbiter, mbuiter, called mbitern, mbuitern
> ('n' for "new"), that allow better optimization by current GCC.
I've called these variants 'mbiterf' and 'mbuiterf'. The benchmarks
now show decent performance for ASCII text (tests a and b):
$ ./gnulib-tool --create-testdir --dir=../testdir1 --single-configure --symlink
mbuiterf-bench-tests mbiterf-bench-tests mbrtoc32-regular
$ cd ../testdir1
$ patch -p1 < .../y.diff
mbiterf mbcel mbuiterf
a 0.226 0.220 0.206
b 0.231 0.221 0.205
c 1.145 0.670 1.179
d 0.850 0.715 0.882
e 0.894 0.720 0.939
f 13.028 5.714 14.654
g 8.855 6.694 9.601
h 8.618 6.596 10.072
i 3.955 2.828 4.631
j 4.169 3.027 4.756
Thanks Paul for the insights!
Bruno