Description
When having an Api with several operations, its possible that the total parameters tend to grow. When you have kramdown markup enabled its possible that the endpoint response tend to become drastically slow. I currently have a case where my endpoint consist of 19 operations with a total of 72 parameters and kramdown enabled. The current benchmarks are:
user system total real
3.170000 0.030000 3.200000 ( 3.210574)
It takes about 3 seconds to load down one single endpoint. Upon disabling kramdown these are the following specs.
user system total real
0.160000 0.000000 0.160000 ( 0.156400)
This is quite acceptable but the notes and documentation do not get formatted at all.
I noticed that parameter description are formatted as well. In my opinion majority of the cases would not use formatted parameter descriptions. Descriptions consists of mostly single lines. And there might be some edge cases where you want your description italic. Upon disabling markdown for descriptions the specs are:
user system total real
0.870000 0.000000 0.870000 ( 0.886495)
In my opinion this is more acceptable. There are 3 kind of options what we could do to improve the speed when markdown is enabled.
- Remove markdown upon descriptions, it isn't documented that means less people know it.
- Add options to the type of markdown you want.
- markdown: :all ( would mark down everything)
- markdown :none ( would mark down nothing)
- markdown :notes (would only mark down notes)
- Remove the kramdown gem and add redcarpet instead. See benchmark specs. But this would have a major effect on the gem itself..
This topic is open for discussion.