jlong / radius

A small, but powerful tag-based template language for Ruby modeled after the ones used in MovableType and TextPattern. It has tags similar to XML, but can be used to generate any form of plain text (HTML, e-mail, etc...).
MIT License
101 stars 21 forks source link

Ran ragel with the -F1 option which produces twice as fast code #10

Closed jfahrenkrug closed 13 years ago

jfahrenkrug commented 13 years ago

I ran ragel with the -F1 option which produces twice as fast code for the scanner. I added a performance test that demonstrates the speed improvement. It is still a lot slower than the old parser, though.

jlong commented 13 years ago

@bkerley What do you think of this? Happy to merge if you think it's a good idea.

bkerley commented 13 years ago

If the tests pass, I'm fine with it.

On Jul 19, 2011, at 10:59, jlongreply@reply.github.com wrote:

@bkerley What do you think of this? Happy to merge if you think it's a good idea.

Reply to this email directly or view it on GitHub: https://github.com/jlong/radius/pull/10#issuecomment-1608130

jfahrenkrug commented 13 years ago

I ran the tests and they pass, but please feel free to double check!

jfahrenkrug commented 13 years ago

The tests fail with ruby 1.8.6 because Fixnum doesn't have the ord method. That is easily fixed, though. Just adding this helps:

class Fixnum
  def ord
    self
  end
end

Because all the ord method does is return the number itself, see: http://www.ruby-doc.org/core-1.8.7/classes/Integer.html#M000062