It was an exact port including bugs — output needed to be exactly the same as that was the best way to test the result. I wouldn't say the Scala code was any more optimized than the Ruby code was over the years. In fact, lots more effort had been put against optimizing the Ruby side (for example, the template engine was written in C for performance).