I have a number of batch scripts that display file directories with long descriptions. The output from PDIR, ending with the file or directory description that may extend beyond the width of the screen, is piped into a program that wraps each line with a hanging indent to make a neat display.
I'm not sure when I noticed that the response was slower than I remember. It is perhaps worse with the latest build (34), but it probably started earlier. Eventually, I experimented with changing the code from something like
pdir ... | hanging_indent.exe
to
pdir ... |! hanging_indent.exe
and I noticed a huge speed-up. Here is some output from a test that was redirecting a typed text file into XSORT. I ran it many times and got more or less the same results each time.
->test.btm
running with standard pipe
Timer 1 on: 17:25:03
Timer 1 off: 17:25:04 Elapsed: 0:00:00.617
running with in-process pipe
Timer 1 on: 17:25:04
Timer 1 off: 17:25:04 Elapsed: 0:00:00.107
My TCSTART script has code at the beginning to exit promptly if TCC is running in a pipe. But plugins are being loaded. Just now, I put the following at the very beginning:
if %_pipe NE 0 quit . It made no difference.
The same behavior occurs in ConPTY and non-ConPTY sessions. I went back to TCMD 35. I could not use XSORT and used TPIPE instead. The time difference between TCMD35 and TCMD36 was not that different (version 35 was slower for both kinds of pipes, but the in-process pipe was dramatically faster.
Here, by the way, is what the output looks like with the piping into the hanging indent program. At first, I used TCC code to do the wrapping, but it could be pretty slow. I figured that compiled code would be much faster. I asked AI to generate Pascal code for me and was amazed that it worked essentially perfectly on the first try.