Hi Mark,
indeed, setting buffering with (setvbuf ...) solved the issue.
Thanks a lot!
For some reason that I don't know, possibly historical, the pipes
created by procedures in (ice-9 popen) are unbuffered by default.
I think you're right, but doesn't the manual suggest otherwise, when
it says "Each direction has PIPE_BUF bytes of buffering"
(https://www.gnu.org/software/guile/manual/html_node/Pipes.html)? Or
do I misinterpret that?
Also, let me mention that the statistical profiler from the
(statprof) module has been very useful to isolate the problem.
Initially I assumed the slowness was due to the external process.
Only after running statprof did I realize that the problem was in my
code.
Thomas