So I tweaked my input-parsing code in both Lisp and COBOL, and switched to SBCL (Steel Bank Common Lisp). When compiled, here are the running speeds of my programs:
My COBOL code is not as complete as the Lisp code, as it has some experimental sections. It uses STRING and UNSTRING a lot. STRING functionality was a recent addition, and it seems to completely kill performance. The COBOL code is not even processing all the inputs.
So far then, COBOL is not performing up to the level of a naive bash script I wrote. The bash script is shorter.
You might be asking about how comes the C++ program takes so long. Well, the C++ is the main calculating engine, and it calls the bash command as a preprocessor, interprets the output from it, does the actual complicated processing, and finally calls a post-processing bash script. It is doing much more work than all of the other programs.
So at least 0.289s of that 0.411s is just running the preprocessor. The sensible next step would be for me to try to cut out the preprocessing script entirely, and subsume it in C++. It seems reasonable to suppose that the time saved would be very high.