-
Notifications
You must be signed in to change notification settings - Fork 46
funny_things
One funny thing I tried is to run omd's output through omd over and over again... to see what it'd look like (well, I'd simply expect some slowdown and for omd to reach the fix point after one or 2 additional iterations). It turned out that I had to launch a lot (really, a lot) of instances of omd to observe some slowdown.
$ time echo '<a><img></img></a>' |omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd|omd
<p><a><img></img></a></p>
real 0m0.247s
user 0m0.371s
sys 0m0.364s
===> 174 instances of omd! And it was then really observable for the human eye... It's not 174 times slower than just one instance of omd, the growth is not linear at all, which is kind of normal since the execution times are so small. (0m0.013s for 5 instances of omd, 0.008s for 1).
Then, I wondered how pandoc would do; just being curious. So I replaced all 174 instances of omd by pandoc... Well, it took quite some time, enough for me to wonder if something went wrong or not. Surprisingly, here's the output, verbatim:
$ time echo '<a><img></img></a>' |pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc|pandoc
<p>
<a><img></img></a>
</p>
real 0m44.381s
user 0m6.671s
sys 0m20.383s
yes, will all those empty lines... It's pandoc 1.11.1 of Mar 17, 2013, on OS X. Surprisingly, when pandoc is given a paragraph, it adds 2 empty lines after it. So, indeed, there are about 340 empty lines above. It's not exactly 340 since the first instance of pandoc doesn't receive a paragraph.