jgm / djot

A light markup language
https://djot.net
MIT License
1.73k stars 43 forks source link

Pandoc writer: Make fewer calls to `literal`. #7

Closed tarleb closed 2 years ago

tarleb commented 2 years ago

The functions in pandoc.layout call into Haskell, which makes them slower than normal Lua functions. Lua strings are treated as if they were created with literal by all these functions, making the calls redundant.

This change reduces the writer's run-time by about ⅓ in my tests.

jgm commented 2 years ago

Thanks, I didn't know!