The answer is a pretty big yes. Glibc's isalnum is about 6-7 times faster than musl's.
Benchmark code: https://paste.sr.ht/~minus/18b44cfe58789bc1fb69494130e859a11...
The answer is a pretty big yes. Glibc's isalnum is about 6-7 times faster than musl's.
Benchmark code: https://paste.sr.ht/~minus/18b44cfe58789bc1fb69494130e859a11...
And even if you want to use a LUT, other implementations have incorporated a LUT without this segfault issue, for instance plan 9:
https://code.9front.org/hg/plan9front/file/00397858f3d8/sys/...
https://code.9front.org/hg/plan9front/file/00397858f3d8/sys/...
And I fully agree with you that this glibc code is awful. As evidenced by the Plan 9 implementation, table lookups can be done simple as well, and probably perform just the same.
For those interested: The technique is used in P. J. Plauger's 1992 The Standard C Library and has been around a long time.