Oh wait, now #lisp is faster than #cobol

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:

bash 0.289s
cobol 0.260s
sbcl 0.150s
C++(++) 0.411s

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.


About mcturra2000

Computer programmer living in Scotland.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s