perl5 icon indicating copy to clipboard operation
perl5 copied to clipboard

optimize/cleanup generate_uudmap.c

Open bulk88 opened this issue 1 year ago • 0 comments

See patch decriptions, fputc() is very unwise CPU wise. Original intent was to put all 3 output .h files in stack array buffers, but it was impossible to get sanely get mg_data.h under 4096 bytes, so I stopped after eliminating the worst FD I/O calls (putch()) and outputting ~80-100 byte lines is better. Full "mimifying" mg_data.h got it ~3700 bytes for me, but that is unreadable. After this patch mg_data is 4.3KB. 4096 byte boundary is artificial picked, since rumors on Google say some POSIX OSes require root/rlimit/cgroups/faux-sudo/ writing "/proc" and magic compiler flags, if you want > 8KB C stacks. Therefore, don't crash "so early", and defer the crash risk much later, to Configure or Makefile.SH or perl.bin crashing, not generate_uudmap.bin.

Also a benefit is stripping pointless ", 0, 0, 0}"s, less work for CC.

This is branched out into this pull, since major problems in sv_inline.h is another topic. Not sure if I will actually need a pre-perl generated .h or not to fix that, but I need the provisions at minimum.

bulk88 avatar Oct 10 '24 02:10 bulk88