Interesting performance and behaviour difference between shells and the "read" builtin.
After upgrading to macOS Sonoma I noticed the #pkgsrc check-portability script occasionally taking over an hour and falling foul of my "ulimit -t 3600".
$ wc text-public.js.map
0 960590 13488786 text-public.js.map
Time to "read f < text-public.js.map" and wc $f:
#bash: 0.5 seconds
1 960590 13060347
#mksh: 6.2 seconds
15904 973513 13030108
#dash: 6.4 seconds
15903 973410 13033181
While we could add a bunch of CHECK_PORTABILITY_SKIP entries to skip these files, I prefer to fix things properly, and so have committed a general fix for this which should speed up most packages.
https://github.com/TritonDataCenter/pkgsrc/commit/df1af49c2953c235c8af501a53f13cdfa5bbf91c
Nice reduction in runtime from 86 seconds down to just 1!
If anyone has access to really old systems and are able to tell me if they do not have "read -n" then that'd be hugely appreciated, though it's likely we'd bootstrap #mksh on them anyway.