Yes, pandoc is not optimized for speed and memory use but extensibility. If there's no feature you need in pandoc, there probably be better solutions out there. I know that MultiMarkdown is highly optimized in C too. But I don't know how it compares to Discount.

On the other hand, for some of us, sticking with pandoc is way easier in terms of extensibility and "future compatibility". And regarding performance, depending on your project size and the amount of new contents you are creating, that might be irrelevant. e.g. if you use makefile to build your project (or any other build system like Jekyll), it will not rebuild targets that's already been built and not updated. And then you can always do something like `make -j` to build in parallel. And lastly, if you are building static pages, generation speed is usually not too important unless your project is really really huge.

It sounds like your project is kind of large scale and want to be as optimized as possible (in terms of page rank, rendering speed, etc.). So if you describe more about your use case, we might be able to give better advice.

By the way, I almost forgot to mention, @jgm has mentioned that if you use commonmark output from pandoc, it will be much faster. If you don't need the extra features pandoc markdown has in addition to those in commonmark, you might give it a try and see if its performance satisfies you.

P.S. I has a friend who was mentored by a Haskell language designer, and he once said "coding in Haskell is trading time for correctness". And that's exactly why pandoc can handle such complexity with relative ease (@jgm has praised Haskell's compiler in order for him to handle this complexity).

On Tuesday, May 2, 2017 at 2:28:58 PM UTC-7, supp...-ZohPw8X7yHTQT0dZR+AlfA@public.gmane.org wrote:
On Tue, May 02, 2017 at 02:09:50PM -0700, mb21 wrote:
> @Jean, you know you can specify image sizes in pandoc as well, right? see
> http://pandoc.org/MANUAL.html#images

I see that, it is nice usable tool and I use it. I also use Pandoc to
convert HTML to text, at least temporarily, as it may show HTTP links
within the text body, which is nice feature.

Before I was using elinks browser with --dump option, and links appear
then on the bottom of the page.

However, it is not as good for my production and the website revision
system with hundreds (thousands) of markdown pages, as it is too
slow.

If I add AMP pages, that means there is double number of pages to
process. Pandoc is not thinkable for the large work, after short
review and stupid benchmark below.

time lisp -x '(loop for i from 1 to 1000 do (shell "pandoc -f markdown -t html  tmp/benchmark.md > /dev/null" ))'

NIL

real    2m30.604s
user    2m13.572s
sys     0m10.972s


time lisp -x '(loop for i from 1 to 1000 do (shell "discount_markdown tmp/benchmark.md > /dev/null" ))'
NIL

real    0m6.388s
user    0m0.060s
sys     0m0.056s

the difference should be very obvious. Discount markdown is way better
for markdown, while Pandoc is way better for general purpose
conversions and is too slow for huge collection of markdown pages.

Discount markdown: www.pell.portland.or.us/~orc/Code/discount/

Jean

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/8fe02f4f-a2e4-4c86-ad1c-3fc90cdfdb72%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.