Forum: Redcloth looking for textile reference in textile source for benchmarking

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Stephen Bannasch (Guest)
on 2009-04-08 19:16
(Received via mailing list)

Do you have any of the longer textile reference documents online in
textile source format.

I wanted to try benchmarking redcloth on them and comparing it to
what Maurico found benchmarking bluecloth.


The markdown syntax document he is benchmarking is about 11k.

You can see my results duplicating the bluecloth results here:

and in a graph:

I was curious how fast redcloth would be at a comparable task and
whether redcloth would also show non-linear processing times as the
input document got larger.
C4a4cc53f32037a1315a2c6ada011a2e?d=identicon&s=25 Jason G. (jgarber)
on 2009-04-08 22:32
(Received via mailing list)
Attachment: textile-dump-of-manual.textile (6 KB)
No, they're all in individual entries in the CMS, but it shouldn't
take me long to have it loop over them and dump as plain text...

<r:find url="/textile/">
<r:content part="input" />

<r:content part="input" />


Easy enough!  The result is attached.
Stephen Bannasch (Guest)
on 2009-04-11 09:09
(Received via mailing list)
Thanks Jason,

Here are some interesting results testing in MRI 1.8.6 and JRuby.

Testing BlueCloth:

Testing RedCloth:
C4a4cc53f32037a1315a2c6ada011a2e?d=identicon&s=25 Jason G. (jgarber)
on 2009-04-14 03:42
(Received via mailing list)
Interesting.  Care to offer any interpretation?
Stephen Bannasch (Guest)
on 2009-04-14 04:55
(Received via mailing list)
At 9:41 PM -0400 4/13/09, Jason Garber wrote:
>Interesting.  Care to offer any interpretation?

BlueCloth is much slower and the time for processing increases
quadratically as the input document get's larger. I haven't looked at

RedCloth is about 15x faster and scales linearly -- again I'm not
sure why but I like that behavior ;-)

When most of the processing time is spent in Ruby regex's (bluecloth)
JRuby is about twice as fast.

Running RedCloth in JRuby however is only about 10% faster. From
previous benchmarking of Hpricot I suspect that the ragel code in
Java is just a bit slower than the C and the speedup is due to other
areas where JRuby is faster.

The context for the benchmarking is a blog post here:

Mauricio's implementation of a simple markdown processor in OCaml
appears to be about 20x faster than RedCloth.

I'd like to know a good way of measuring "real" memory use when
running a benchmark like this in Ruby especially one that involves a
native library. Mauricio's reports very low memory usage from his
OCaml implementation.
C4a4cc53f32037a1315a2c6ada011a2e?d=identicon&s=25 Jason G. (jgarber)
on 2009-04-14 20:55
(Received via mailing list)
Awesome.  Thanks, Stephen!
This topic is locked and can not be replied to.