Factor Language Blog

Poor I/O performance

Thursday, July 27, 2006

When I saw this weblog entry, I decided to port the reverse complement benchmark to Factor. The benchmark took a whopping 51 minutes to run on my G5, compared to 3 seconds for the Java version. There are definitely some low-hanging fruit in the I/O code. I’ll start working on I/O performance in Factor 0.84, and hopefully improve on the benchmark result by several orders of magnitude.

Update: I ported the benchmark wrong. The initial buffer size was wrong; 3mb versus 30mb, so there was a lot of copying going on. Fixing this, the run time decreased to 170 seconds. Still poor, but not nearly as bad. 120 seconds are spent simply reading the file, line by line. This will be the first thing I will optimize in 0.84.

Here is the benchmark code. It seems to be clearer and simpler than most of the implementations on that page.