Slow Languages Battle Across Time
Programming in the 21st Century - James Hague - November 14, 2009In my previous optimistic outburst I asserted that “Even a language like Ruby, which tends to hang near the bottom of any performance-oriented benchmark, is thousands of times faster than BASICs that people were learning to program 8-bit home computers with in the 1980s.” That was based on some timings I did five years ago, so I decided to revisit them.
The benchmark I used is the old and not-very-good-as-a-benchmark Sieve of Eratosthenes, because that’s the only benchmark that I have numbers for in Atari BASIC on original 8-bit computer hardware. Rather than using Ruby as the modern-day language, I’m using Python, simply because I already have it installed. It’s a fair swap, as Python doesn’t have a reputation for performance either.
The sieve in Atari BASIC, using timings from an article written in 1984 by Brian Moriarty, clocks in at:
324 seconds (or just under 5 and a half minutes)
The Python version, running on hardware that’s a generation back—no i7 processor or anything like that—completes in:
3 seconds
Now that’s impressive! A straight-ahead interpreted language, one with garbage collection and dynamic typing and memory allocation all over the place, and it’s still two orders of magnitude, 108 times, faster than what hobbyist programmers had to work with twenty-five years ago. But what about the “thousands of times” figure I tossed about in the first paragraph?
Oh, yes, I forgot to mention that the Python code is running the full Sieve algorithm one thousand times.
If the Atari BASIC program ran a thousand times, it would finish after 324,000 seconds or 5400 minutes or almost four days. That means the Python version is—get ready for this—108,000 times faster than the Atari BASIC code.
That’s progress.
(If you liked this, you might also like A Spellchecker Used to be a Major Feat of Software Engineering.)
Categories: Blogs Programming in the 21st Century
Erlang on Twitter
» SophieLambrakis (Sophie Lambrakis): RT @Robin_B: Behind the scenes of a multi-agent interactive drama game, by Richard Evans. Super-interesting use of erlang and exclusion log…
» 0xAX (0xAX): strange, rebar shows—commands command line option, but it doesn’t work, but -c works fine. #erlang
» erlnews (Erlang news): Stumbling Into the Cold Expanse of Real Programming http://t.co/yXVpndZHkB #erlang
» Robin_B (Robin Baumgarten): Behind the scenes of a multi-agent interactive drama game, by Richard Evans. Super-interesting use of erlang and exclusion logic. #GaME13
» golander59 (Gib Olander): RT @coreyhaines: In Chicago on Monday? Want to see me give a book report on neural networks and erlang? http://t.co/ZvJUfuTfpH
» common_disease (смерть автора): @ungzd Erlang-то возьми
» erlnews (Erlang news): Strange thing about mongodb-erlang driver when using replica set #erlang http://t.co/19ZamtgrPI
» jboursiquot (Johnny Boursiquot): In order to “get” Erlang, I’m spending some time with Prolog first. But damn this stuff is weird (for the moment) #MindExpansionJutsu
» seriyps (Sergey Prokhorov): Портировал “Walker Alias” - алгоритм случайного выбора с вероятностями на Erlang. https://t.co/JJrezSoki4 Уверен, можно сделать эффективнее
» immobilo_erlang (Wohnung Erlangen): Gut geschnittene 2-Zimmer-Wohnung mit 2 Balkonen im Erlanger Westen: 450,00 € / Miete
2 Zimmer, 62 m²
91056 Er… http://t.co/t3PPiCOwCQ
Statistics
Number of aggregated posts: 10649
Most recent article: May 19, 2013
Latest comments
» Moraru on This is Why You Spent All that Time Learning to Program: It is true that computer science was a pain in the back at time that i’ve had to learn it…
» Commercial hand dryers on Couchbase Meetup at new HQ: Buy online from here where you will get so much of variety in Commercial hand dryers for people. If you…
» Fort McMurray Homes on Motivated Reasoning and Erlang vs Python vs Node: I don’t really understand why this post is motivational? I don’t even see a post, just a title. Fort McMurray…